const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const dom = new JSDOM(`<!DOCTYPE html><p>Hello world</p>`);
window = dom.window;
document = window.document;
XMLHttpRequest = window.XMLHttpRequest;
global.navigator={
    userAgent: 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36',
    navPlatform: 'win32',
    language: 'zh-CN'
};
global.alert = function (msg) {};

var encryptClass = function() {
            "use strict";
            var e = "0123456789abcdefghijklmnopqrstuvwxyz";
            function r(t) {
                return e.charAt(t)
            }
            function n(t, e) {
                return t & e
            }
            function o(t, e) {
                return t | e
            }
            function i(t, e) {
                return t ^ e
            }
            function a(t, e) {
                return t & ~e
            }
            function s(t) {
                if (0 == t)
                    return -1;
                var e = 0;
                return 0 == (65535 & t) && (t >>= 16,
                e += 16),
                0 == (255 & t) && (t >>= 8,
                e += 8),
                0 == (15 & t) && (t >>= 4,
                e += 4),
                0 == (3 & t) && (t >>= 2,
                e += 2),
                0 == (1 & t) && ++e,
                e
            }
            function l(t) {
                for (var e = 0; 0 != t; )
                    t &= t - 1,
                    ++e;
                return e
            }
            var c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
              , u = "=";
            function p(t) {
                var e, r, n = "";
                for (e = 0; e + 3 <= t.length; e += 3)
                    r = parseInt(t.substring(e, e + 3), 16),
                    n += c.charAt(r >> 6) + c.charAt(63 & r);
                for (e + 1 == t.length ? (r = parseInt(t.substring(e, e + 1), 16),
                n += c.charAt(r << 2)) : e + 2 == t.length && (r = parseInt(t.substring(e, e + 2), 16),
                n += c.charAt(r >> 2) + c.charAt((3 & r) << 4)); (3 & n.length) > 0; )
                    n += u;
                return n
            }
            function f(t) {
                var e, n = "", o = 0, i = 0;
                for (e = 0; e < t.length && t.charAt(e) != u; ++e) {
                    var a = c.indexOf(t.charAt(e));
                    a < 0 || (0 == o ? (n += r(a >> 2),
                    i = 3 & a,
                    o = 1) : 1 == o ? (n += r(i << 2 | a >> 4),
                    i = 15 & a,
                    o = 2) : 2 == o ? (n += r(i),
                    n += r(a >> 2),
                    i = 3 & a,
                    o = 3) : (n += r(i << 2 | a >> 4),
                    n += r(15 & a),
                    o = 0))
                }
                return 1 == o && (n += r(i << 2)),
                n
            }
            /*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
            var h, d, g = function(t, e) {
                return (g = Object.setPrototypeOf || {
                    __proto__: []
                }instanceof Array && function(t, e) {
                    t.__proto__ = e
                }
                || function(t, e) {
                    for (var r in e)
                        e.hasOwnProperty(r) && (t[r] = e[r])
                }
                )(t, e)
            }, m = {
                decode: function(t) {
                    var e;
                    if (void 0 === h) {
                        var r = "0123456789ABCDEF"
                          , n = " \f\n\r\t \u2028\u2029";
                        for (h = {},
                        e = 0; e < 16; ++e)
                            h[r.charAt(e)] = e;
                        for (r = r.toLowerCase(),
                        e = 10; e < 16; ++e)
                            h[r.charAt(e)] = e;
                        for (e = 0; e < n.length; ++e)
                            h[n.charAt(e)] = -1
                    }
                    var o = []
                      , i = 0
                      , a = 0;
                    for (e = 0; e < t.length; ++e) {
                        var s = t.charAt(e);
                        if ("=" == s)
                            break;
                        if (-1 != (s = h[s])) {
                            if (void 0 === s)
                                throw new Error("Illegal character at offset " + e);
                            i |= s,
                            ++a >= 2 ? (o[o.length] = i,
                            i = 0,
                            a = 0) : i <<= 4
                        }
                    }
                    if (a)
                        throw new Error("Hex encoding incomplete: 4 bits missing");
                    return o
                }
            }, v = {
                decode: function(t) {
                    var e;
                    if (void 0 === d) {
                        var r = "= \f\n\r\t \u2028\u2029";
                        for (d = Object.create(null),
                        e = 0; e < 64; ++e)
                            d["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)] = e;
                        for (e = 0; e < r.length; ++e)
                            d[r.charAt(e)] = -1
                    }
                    var n = []
                      , o = 0
                      , i = 0;
                    for (e = 0; e < t.length; ++e) {
                        var a = t.charAt(e);
                        if ("=" == a)
                            break;
                        if (-1 != (a = d[a])) {
                            if (void 0 === a)
                                throw new Error("Illegal character at offset " + e);
                            o |= a,
                            ++i >= 4 ? (n[n.length] = o >> 16,
                            n[n.length] = o >> 8 & 255,
                            n[n.length] = 255 & o,
                            o = 0,
                            i = 0) : o <<= 6
                        }
                    }
                    switch (i) {
                    case 1:
                        throw new Error("Base64 encoding incomplete: at least 2 bits missing");
                    case 2:
                        n[n.length] = o >> 10;
                        break;
                    case 3:
                        n[n.length] = o >> 16,
                        n[n.length] = o >> 8 & 255
                    }
                    return n
                },
                re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,
                unarmor: function(t) {
                    var e = v.re.exec(t);
                    if (e)
                        if (e[1])
                            t = e[1];
                        else {
                            if (!e[2])
                                throw new Error("RegExp out of sync");
                            t = e[2]
                        }
                    return v.decode(t)
                }
            }, b = function() {
                function t(t) {
                    this.buf = [+t || 0]
                }
                return t.prototype.mulAdd = function(t, e) {
                    var r, n, o = this.buf, i = o.length;
                    for (r = 0; r < i; ++r)
                        (n = o[r] * t + e) < 1e13 ? e = 0 : n -= 1e13 * (e = 0 | n / 1e13),
                        o[r] = n;
                    e > 0 && (o[r] = e)
                }
                ,
                t.prototype.sub = function(t) {
                    var e, r, n = this.buf, o = n.length;
                    for (e = 0; e < o; ++e)
                        (r = n[e] - t) < 0 ? (r += 1e13,
                        t = 1) : t = 0,
                        n[e] = r;
                    for (; 0 === n[n.length - 1]; )
                        n.pop()
                }
                ,
                t.prototype.toString = function(t) {
                    if (10 != (t || 10))
                        throw new Error("only base 10 is supported");
                    for (var e = this.buf, r = e[e.length - 1].toString(), n = e.length - 2; n >= 0; --n)
                        r += (1e13 + e[n]).toString().substring(1);
                    return r
                }
                ,
                t.prototype.valueOf = function() {
                    for (var t = this.buf, e = 0, r = t.length - 1; r >= 0; --r)
                        e = 1e13 * e + t[r];
                    return e
                }
                ,
                t.prototype.simplify = function() {
                    var t = this.buf;
                    return 1 == t.length ? t[0] : this
                }
                ,
                t
            }(), y = "…", w = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/, S = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
            function x(t, e) {
                return t.length > e && (t = t.substring(0, e) + y),
                t
            }
            var C, E = function() {
                function t(e, r) {
                    this.hexDigits = "0123456789ABCDEF",
                    e instanceof t ? (this.enc = e.enc,
                    this.pos = e.pos) : (this.enc = e,
                    this.pos = r)
                }
                return t.prototype.get = function(t) {
                    if (void 0 === t && (t = this.pos++),
                    t >= this.enc.length)
                        throw new Error("Requesting byte offset " + t + " on a stream of length " + this.enc.length);
                    return "string" == typeof this.enc ? this.enc.charCodeAt(t) : this.enc[t]
                }
                ,
                t.prototype.hexByte = function(t) {
                    return this.hexDigits.charAt(t >> 4 & 15) + this.hexDigits.charAt(15 & t)
                }
                ,
                t.prototype.hexDump = function(t, e, r) {
                    for (var n = "", o = t; o < e; ++o)
                        if (n += this.hexByte(this.get(o)),
                        !0 !== r)
                            switch (15 & o) {
                            case 7:
                                n += "  ";
                                break;
                            case 15:
                                n += "\n";
                                break;
                            default:
                                n += " "
                            }
                    return n
                }
                ,
                t.prototype.isASCII = function(t, e) {
                    for (var r = t; r < e; ++r) {
                        var n = this.get(r);
                        if (n < 32 || n > 176)
                            return !1
                    }
                    return !0
                }
                ,
                t.prototype.parseStringISO = function(t, e) {
                    for (var r = "", n = t; n < e; ++n)
                        r += String.fromCharCode(this.get(n));
                    return r
                }
                ,
                t.prototype.parseStringUTF = function(t, e) {
                    for (var r = "", n = t; n < e; ) {
                        var o = this.get(n++);
                        r += o < 128 ? String.fromCharCode(o) : o > 191 && o < 224 ? String.fromCharCode((31 & o) << 6 | 63 & this.get(n++)) : String.fromCharCode((15 & o) << 12 | (63 & this.get(n++)) << 6 | 63 & this.get(n++))
                    }
                    return r
                }
                ,
                t.prototype.parseStringBMP = function(t, e) {
                    for (var r, n, o = "", i = t; i < e; )
                        r = this.get(i++),
                        n = this.get(i++),
                        o += String.fromCharCode(r << 8 | n);
                    return o
                }
                ,
                t.prototype.parseTime = function(t, e, r) {
                    var n = this.parseStringISO(t, e)
                      , o = (r ? w : S).exec(n);
                    return o ? (r && (o[1] = +o[1],
                    o[1] += +o[1] < 70 ? 2e3 : 1900),
                    n = o[1] + "-" + o[2] + "-" + o[3] + " " + o[4],
                    o[5] && (n += ":" + o[5],
                    o[6] && (n += ":" + o[6],
                    o[7] && (n += "." + o[7]))),
                    o[8] && (n += " UTC",
                    "Z" != o[8] && (n += o[8],
                    o[9] && (n += ":" + o[9]))),
                    n) : "Unrecognized time: " + n
                }
                ,
                t.prototype.parseInteger = function(t, e) {
                    for (var r, n = this.get(t), o = n > 127, i = o ? 255 : 0, a = ""; n == i && ++t < e; )
                        n = this.get(t);
                    if (0 == (r = e - t))
                        return o ? -1 : 0;
                    if (r > 4) {
                        for (a = n,
                        r <<= 3; 0 == (128 & (+a ^ i)); )
                            a = +a << 1,
                            --r;
                        a = "(" + r + " bit)\n"
                    }
                    o && (n -= 256);
                    for (var s = new b(n), l = t + 1; l < e; ++l)
                        s.mulAdd(256, this.get(l));
                    return a + s.toString()
                }
                ,
                t.prototype.parseBitString = function(t, e, r) {
                    for (var n = this.get(t), o = (e - t - 1 << 3) - n, i = "(" + o + " bit)\n", a = "", s = t + 1; s < e; ++s) {
                        for (var l = this.get(s), c = s == e - 1 ? n : 0, u = 7; u >= c; --u)
                            a += l >> u & 1 ? "1" : "0";
                        if (a.length > r)
                            return i + x(a, r)
                    }
                    return i + a
                }
                ,
                t.prototype.parseOctetString = function(t, e, r) {
                    if (this.isASCII(t, e))
                        return x(this.parseStringISO(t, e), r);
                    var n = e - t
                      , o = "(" + n + " byte)\n";
                    n > (r /= 2) && (e = t + r);
                    for (var i = t; i < e; ++i)
                        o += this.hexByte(this.get(i));
                    return n > r && (o += y),
                    o
                }
                ,
                t.prototype.parseOID = function(t, e, r) {
                    for (var n = "", o = new b, i = 0, a = t; a < e; ++a) {
                        var s = this.get(a);
                        if (o.mulAdd(128, 127 & s),
                        i += 7,
                        !(128 & s)) {
                            if ("" === n)
                                if ((o = o.simplify())instanceof b)
                                    o.sub(80),
                                    n = "2." + o.toString();
                                else {
                                    var l = o < 80 ? o < 40 ? 0 : 1 : 2;
                                    n = l + "." + (o - 40 * l)
                                }
                            else
                                n += "." + o.toString();
                            if (n.length > r)
                                return x(n, r);
                            o = new b,
                            i = 0
                        }
                    }
                    return i > 0 && (n += ".incomplete"),
                    n
                }
                ,
                t
            }(), O = function() {
                function t(t, e, r, n, o) {
                    if (!(n instanceof I))
                        throw new Error("Invalid tag value.");
                    this.stream = t,
                    this.header = e,
                    this.length = r,
                    this.tag = n,
                    this.sub = o
                }
                return t.prototype.typeName = function() {
                    switch (this.tag.tagClass) {
                    case 0:
                        switch (this.tag.tagNumber) {
                        case 0:
                            return "EOC";
                        case 1:
                            return "BOOLEAN";
                        case 2:
                            return "INTEGER";
                        case 3:
                            return "BIT_STRING";
                        case 4:
                            return "OCTET_STRING";
                        case 5:
                            return "NULL";
                        case 6:
                            return "OBJECT_IDENTIFIER";
                        case 7:
                            return "ObjectDescriptor";
                        case 8:
                            return "EXTERNAL";
                        case 9:
                            return "REAL";
                        case 10:
                            return "ENUMERATED";
                        case 11:
                            return "EMBEDDED_PDV";
                        case 12:
                            return "UTF8String";
                        case 16:
                            return "SEQUENCE";
                        case 17:
                            return "SET";
                        case 18:
                            return "NumericString";
                        case 19:
                            return "PrintableString";
                        case 20:
                            return "TeletexString";
                        case 21:
                            return "VideotexString";
                        case 22:
                            return "IA5String";
                        case 23:
                            return "UTCTime";
                        case 24:
                            return "GeneralizedTime";
                        case 25:
                            return "GraphicString";
                        case 26:
                            return "VisibleString";
                        case 27:
                            return "GeneralString";
                        case 28:
                            return "UniversalString";
                        case 30:
                            return "BMPString"
                        }
                        return "Universal_" + this.tag.tagNumber.toString();
                    case 1:
                        return "Application_" + this.tag.tagNumber.toString();
                    case 2:
                        return "[" + this.tag.tagNumber.toString() + "]";
                    case 3:
                        return "Private_" + this.tag.tagNumber.toString()
                    }
                }
                ,
                t.prototype.content = function(t) {
                    if (void 0 === this.tag)
                        return null;
                    void 0 === t && (t = 1 / 0);
                    var e = this.posContent()
                      , r = Math.abs(this.length);
                    if (!this.tag.isUniversal())
                        return null !== this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(e, e + r, t);
                    switch (this.tag.tagNumber) {
                    case 1:
                        return 0 === this.stream.get(e) ? "false" : "true";
                    case 2:
                        return this.stream.parseInteger(e, e + r);
                    case 3:
                        return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(e, e + r, t);
                    case 4:
                        return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(e, e + r, t);
                    case 6:
                        return this.stream.parseOID(e, e + r, t);
                    case 16:
                    case 17:
                        return null !== this.sub ? "(" + this.sub.length + " elem)" : "(no elem)";
                    case 12:
                        return x(this.stream.parseStringUTF(e, e + r), t);
                    case 18:
                    case 19:
                    case 20:
                    case 21:
                    case 22:
                    case 26:
                        return x(this.stream.parseStringISO(e, e + r), t);
                    case 30:
                        return x(this.stream.parseStringBMP(e, e + r), t);
                    case 23:
                    case 24:
                        return this.stream.parseTime(e, e + r, 23 == this.tag.tagNumber)
                    }
                    return null
                }
                ,
                t.prototype.toString = function() {
                    return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null === this.sub ? "null" : this.sub.length) + "]"
                }
                ,
                t.prototype.toPrettyString = function(t) {
                    void 0 === t && (t = "");
                    var e = t + this.typeName() + " @" + this.stream.pos;
                    if (this.length >= 0 && (e += "+"),
                    e += this.length,
                    this.tag.tagConstructed ? e += " (constructed)" : !this.tag.isUniversal() || 3 != this.tag.tagNumber && 4 != this.tag.tagNumber || null === this.sub || (e += " (encapsulates)"),
                    e += "\n",
                    null !== this.sub) {
                        t += "  ";
                        for (var r = 0, n = this.sub.length; r < n; ++r)
                            e += this.sub[r].toPrettyString(t)
                    }
                    return e
                }
                ,
                t.prototype.posStart = function() {
                    return this.stream.pos
                }
                ,
                t.prototype.posContent = function() {
                    return this.stream.pos + this.header
                }
                ,
                t.prototype.posEnd = function() {
                    return this.stream.pos + this.header + Math.abs(this.length)
                }
                ,
                t.prototype.toHexString = function() {
                    return this.stream.hexDump(this.posStart(), this.posEnd(), !0)
                }
                ,
                t.decodeLength = function(t) {
                    var e = t.get()
                      , r = 127 & e;
                    if (r == e)
                        return r;
                    if (r > 6)
                        throw new Error("Length over 48 bits not supported at position " + (t.pos - 1));
                    if (0 === r)
                        return null;
                    e = 0;
                    for (var n = 0; n < r; ++n)
                        e = 256 * e + t.get();
                    return e
                }
                ,
                t.prototype.getHexStringValue = function() {
                    var t = this.toHexString()
                      , e = 2 * this.header
                      , r = 2 * this.length;
                    return t.substr(e, r)
                }
                ,
                t.decode = function(e) {
                    var r;
                    r = e instanceof E ? e : new E(e,0);
                    var n = new E(r)
                      , o = new I(r)
                      , i = t.decodeLength(r)
                      , a = r.pos
                      , s = a - n.pos
                      , l = null
                      , c = function() {
                        var e = [];
                        if (null !== i) {
                            for (var n = a + i; r.pos < n; )
                                e[e.length] = t.decode(r);
                            if (r.pos != n)
                                throw new Error("Content size is not correct for container starting at offset " + a)
                        } else
                            try {
                                for (; ; ) {
                                    var o = t.decode(r);
                                    if (o.tag.isEOC())
                                        break;
                                    e[e.length] = o
                                }
                                i = a - r.pos
                            } catch (t) {
                                throw new Error("Exception while decoding undefined length content: " + t)
                            }
                        return e
                    };
                    if (o.tagConstructed)
                        l = c();
                    else if (o.isUniversal() && (3 == o.tagNumber || 4 == o.tagNumber))
                        try {
                            if (3 == o.tagNumber && 0 != r.get())
                                throw new Error("BIT STRINGs with unused bits cannot encapsulate.");
                            l = c();
                            for (var u = 0; u < l.length; ++u)
                                if (l[u].tag.isEOC())
                                    throw new Error("EOC is not supposed to be actual content.")
                        } catch (t) {
                            l = null
                        }
                    if (null === l) {
                        if (null === i)
                            throw new Error("We can't skip over an invalid tag with undefined length at offset " + a);
                        r.pos = a + Math.abs(i)
                    }
                    return new t(n,s,i,o,l)
                }
                ,
                t
            }(), I = function() {
                function t(t) {
                    var e = t.get();
                    if (this.tagClass = e >> 6,
                    this.tagConstructed = 0 != (32 & e),
                    this.tagNumber = 31 & e,
                    31 == this.tagNumber) {
                        var r = new b;
                        do {
                            e = t.get(),
                            r.mulAdd(128, 127 & e)
                        } while (128 & e);this.tagNumber = r.simplify()
                    }
                }
                return t.prototype.isUniversal = function() {
                    return 0 === this.tagClass
                }
                ,
                t.prototype.isEOC = function() {
                    return 0 === this.tagClass && 0 === this.tagNumber
                }
                ,
                t
            }(), T = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997], A = (1 << 26) / T[T.length - 1], R = function() {
                function t(t, e, r) {
                    null != t && ("number" == typeof t ? this.fromNumber(t, e, r) : null == e && "string" != typeof t ? this.fromString(t, 256) : this.fromString(t, e))
                }
                return t.prototype.toString = function(t) {
                    if (this.s < 0)
                        return "-" + this.negate().toString(t);
                    var e;
                    if (16 == t)
                        e = 4;
                    else if (8 == t)
                        e = 3;
                    else if (2 == t)
                        e = 1;
                    else if (32 == t)
                        e = 5;
                    else {
                        if (4 != t)
                            return this.toRadix(t);
                        e = 2
                    }
                    var n, o = (1 << e) - 1, i = !1, a = "", s = this.t, l = this.DB - s * this.DB % e;
                    if (s-- > 0)
                        for (l < this.DB && (n = this[s] >> l) > 0 && (i = !0,
                        a = r(n)); s >= 0; )
                            l < e ? (n = (this[s] & (1 << l) - 1) << e - l,
                            n |= this[--s] >> (l += this.DB - e)) : (n = this[s] >> (l -= e) & o,
                            l <= 0 && (l += this.DB,
                            --s)),
                            n > 0 && (i = !0),
                            i && (a += r(n));
                    return i ? a : "0"
                }
                ,
                t.prototype.negate = function() {
                    var e = B();
                    return t.ZERO.subTo(this, e),
                    e
                }
                ,
                t.prototype.abs = function() {
                    return this.s < 0 ? this.negate() : this
                }
                ,
                t.prototype.compareTo = function(t) {
                    var e = this.s - t.s;
                    if (0 != e)
                        return e;
                    var r = this.t;
                    if (0 != (e = r - t.t))
                        return this.s < 0 ? -e : e;
                    for (; --r >= 0; )
                        if (0 != (e = this[r] - t[r]))
                            return e;
                    return 0
                }
                ,
                t.prototype.bitLength = function() {
                    return this.t <= 0 ? 0 : this.DB * (this.t - 1) + $(this[this.t - 1] ^ this.s & this.DM)
                }
                ,
                t.prototype.mod = function(e) {
                    var r = B();
                    return this.abs().divRemTo(e, null, r),
                    this.s < 0 && r.compareTo(t.ZERO) > 0 && e.subTo(r, r),
                    r
                }
                ,
                t.prototype.modPowInt = function(t, e) {
                    var r;
                    return r = t < 256 || e.isEven() ? new k(e) : new D(e),
                    this.exp(t, r)
                }
                ,
                t.prototype.clone = function() {
                    var t = B();
                    return this.copyTo(t),
                    t
                }
                ,
                t.prototype.intValue = function() {
                    if (this.s < 0) {
                        if (1 == this.t)
                            return this[0] - this.DV;
                        if (0 == this.t)
                            return -1
                    } else {
                        if (1 == this.t)
                            return this[0];
                        if (0 == this.t)
                            return 0
                    }
                    return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0]
                }
                ,
                t.prototype.byteValue = function() {
                    return 0 == this.t ? this.s : this[0] << 24 >> 24
                }
                ,
                t.prototype.shortValue = function() {
                    return 0 == this.t ? this.s : this[0] << 16 >> 16
                }
                ,
                t.prototype.signum = function() {
                    return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1
                }
                ,
                t.prototype.toByteArray = function() {
                    var t = this.t
                      , e = [];
                    e[0] = this.s;
                    var r, n = this.DB - t * this.DB % 8, o = 0;
                    if (t-- > 0)
                        for (n < this.DB && (r = this[t] >> n) != (this.s & this.DM) >> n && (e[o++] = r | this.s << this.DB - n); t >= 0; )
                            n < 8 ? (r = (this[t] & (1 << n) - 1) << 8 - n,
                            r |= this[--t] >> (n += this.DB - 8)) : (r = this[t] >> (n -= 8) & 255,
                            n <= 0 && (n += this.DB,
                            --t)),
                            0 != (128 & r) && (r |= -256),
                            0 == o && (128 & this.s) != (128 & r) && ++o,
                            (o > 0 || r != this.s) && (e[o++] = r);
                    return e
                }
                ,
                t.prototype.equals = function(t) {
                    return 0 == this.compareTo(t)
                }
                ,
                t.prototype.min = function(t) {
                    return this.compareTo(t) < 0 ? this : t
                }
                ,
                t.prototype.max = function(t) {
                    return this.compareTo(t) > 0 ? this : t
                }
                ,
                t.prototype.and = function(t) {
                    var e = B();
                    return this.bitwiseTo(t, n, e),
                    e
                }
                ,
                t.prototype.or = function(t) {
                    var e = B();
                    return this.bitwiseTo(t, o, e),
                    e
                }
                ,
                t.prototype.xor = function(t) {
                    var e = B();
                    return this.bitwiseTo(t, i, e),
                    e
                }
                ,
                t.prototype.andNot = function(t) {
                    var e = B();
                    return this.bitwiseTo(t, a, e),
                    e
                }
                ,
                t.prototype.not = function() {
                    for (var t = B(), e = 0; e < this.t; ++e)
                        t[e] = this.DM & ~this[e];
                    return t.t = this.t,
                    t.s = ~this.s,
                    t
                }
                ,
                t.prototype.shiftLeft = function(t) {
                    var e = B();
                    return t < 0 ? this.rShiftTo(-t, e) : this.lShiftTo(t, e),
                    e
                }
                ,
                t.prototype.shiftRight = function(t) {
                    var e = B();
                    return t < 0 ? this.lShiftTo(-t, e) : this.rShiftTo(t, e),
                    e
                }
                ,
                t.prototype.getLowestSetBit = function() {
                    for (var t = 0; t < this.t; ++t)
                        if (0 != this[t])
                            return t * this.DB + s(this[t]);
                    return this.s < 0 ? this.t * this.DB : -1
                }
                ,
                t.prototype.bitCount = function() {
                    for (var t = 0, e = this.s & this.DM, r = 0; r < this.t; ++r)
                        t += l(this[r] ^ e);
                    return t
                }
                ,
                t.prototype.testBit = function(t) {
                    var e = Math.floor(t / this.DB);
                    return e >= this.t ? 0 != this.s : 0 != (this[e] & 1 << t % this.DB)
                }
                ,
                t.prototype.setBit = function(t) {
                    return this.changeBit(t, o)
                }
                ,
                t.prototype.clearBit = function(t) {
                    return this.changeBit(t, a)
                }
                ,
                t.prototype.flipBit = function(t) {
                    return this.changeBit(t, i)
                }
                ,
                t.prototype.add = function(t) {
                    var e = B();
                    return this.addTo(t, e),
                    e
                }
                ,
                t.prototype.subtract = function(t) {
                    var e = B();
                    return this.subTo(t, e),
                    e
                }
                ,
                t.prototype.multiply = function(t) {
                    var e = B();
                    return this.multiplyTo(t, e),
                    e
                }
                ,
                t.prototype.divide = function(t) {
                    var e = B();
                    return this.divRemTo(t, e, null),
                    e
                }
                ,
                t.prototype.remainder = function(t) {
                    var e = B();
                    return this.divRemTo(t, null, e),
                    e
                }
                ,
                t.prototype.divideAndRemainder = function(t) {
                    var e = B()
                      , r = B();
                    return this.divRemTo(t, e, r),
                    [e, r]
                }
                ,
                t.prototype.modPow = function(t, e) {
                    var r, n, o = t.bitLength(), i = V(1);
                    if (o <= 0)
                        return i;
                    r = o < 18 ? 1 : o < 48 ? 3 : o < 144 ? 4 : o < 768 ? 5 : 6,
                    n = o < 8 ? new k(e) : e.isEven() ? new P(e) : new D(e);
                    var a = []
                      , s = 3
                      , l = r - 1
                      , c = (1 << r) - 1;
                    if (a[1] = n.convert(this),
                    r > 1) {
                        var u = B();
                        for (n.sqrTo(a[1], u); s <= c; )
                            a[s] = B(),
                            n.mulTo(u, a[s - 2], a[s]),
                            s += 2
                    }
                    var p, f, h = t.t - 1, d = !0, g = B();
                    for (o = $(t[h]) - 1; h >= 0; ) {
                        for (o >= l ? p = t[h] >> o - l & c : (p = (t[h] & (1 << o + 1) - 1) << l - o,
                        h > 0 && (p |= t[h - 1] >> this.DB + o - l)),
                        s = r; 0 == (1 & p); )
                            p >>= 1,
                            --s;
                        if ((o -= s) < 0 && (o += this.DB,
                        --h),
                        d)
                            a[p].copyTo(i),
                            d = !1;
                        else {
                            for (; s > 1; )
                                n.sqrTo(i, g),
                                n.sqrTo(g, i),
                                s -= 2;
                            s > 0 ? n.sqrTo(i, g) : (f = i,
                            i = g,
                            g = f),
                            n.mulTo(g, a[p], i)
                        }
                        for (; h >= 0 && 0 == (t[h] & 1 << o); )
                            n.sqrTo(i, g),
                            f = i,
                            i = g,
                            g = f,
                            --o < 0 && (o = this.DB - 1,
                            --h)
                    }
                    return n.revert(i)
                }
                ,
                t.prototype.modInverse = function(e) {
                    var r = e.isEven();
                    if (this.isEven() && r || 0 == e.signum())
                        return t.ZERO;
                    for (var n = e.clone(), o = this.clone(), i = V(1), a = V(0), s = V(0), l = V(1); 0 != n.signum(); ) {
                        for (; n.isEven(); )
                            n.rShiftTo(1, n),
                            r ? (i.isEven() && a.isEven() || (i.addTo(this, i),
                            a.subTo(e, a)),
                            i.rShiftTo(1, i)) : a.isEven() || a.subTo(e, a),
                            a.rShiftTo(1, a);
                        for (; o.isEven(); )
                            o.rShiftTo(1, o),
                            r ? (s.isEven() && l.isEven() || (s.addTo(this, s),
                            l.subTo(e, l)),
                            s.rShiftTo(1, s)) : l.isEven() || l.subTo(e, l),
                            l.rShiftTo(1, l);
                        n.compareTo(o) >= 0 ? (n.subTo(o, n),
                        r && i.subTo(s, i),
                        a.subTo(l, a)) : (o.subTo(n, o),
                        r && s.subTo(i, s),
                        l.subTo(a, l))
                    }
                    return 0 != o.compareTo(t.ONE) ? t.ZERO : l.compareTo(e) >= 0 ? l.subtract(e) : l.signum() < 0 ? (l.addTo(e, l),
                    l.signum() < 0 ? l.add(e) : l) : l
                }
                ,
                t.prototype.pow = function(t) {
                    return this.exp(t, new j)
                }
                ,
                t.prototype.gcd = function(t) {
                    var e = this.s < 0 ? this.negate() : this.clone()
                      , r = t.s < 0 ? t.negate() : t.clone();
                    if (e.compareTo(r) < 0) {
                        var n = e;
                        e = r,
                        r = n
                    }
                    var o = e.getLowestSetBit()
                      , i = r.getLowestSetBit();
                    if (i < 0)
                        return e;
                    for (o < i && (i = o),
                    i > 0 && (e.rShiftTo(i, e),
                    r.rShiftTo(i, r)); e.signum() > 0; )
                        (o = e.getLowestSetBit()) > 0 && e.rShiftTo(o, e),
                        (o = r.getLowestSetBit()) > 0 && r.rShiftTo(o, r),
                        e.compareTo(r) >= 0 ? (e.subTo(r, e),
                        e.rShiftTo(1, e)) : (r.subTo(e, r),
                        r.rShiftTo(1, r));
                    return i > 0 && r.lShiftTo(i, r),
                    r
                }
                ,
                t.prototype.isProbablePrime = function(t) {
                    var e, r = this.abs();
                    if (1 == r.t && r[0] <= T[T.length - 1]) {
                        for (e = 0; e < T.length; ++e)
                            if (r[0] == T[e])
                                return !0;
                        return !1
                    }
                    if (r.isEven())
                        return !1;
                    for (e = 1; e < T.length; ) {
                        for (var n = T[e], o = e + 1; o < T.length && n < A; )
                            n *= T[o++];
                        for (n = r.modInt(n); e < o; )
                            if (n % T[e++] == 0)
                                return !1
                    }
                    return r.millerRabin(t)
                }
                ,
                t.prototype.copyTo = function(t) {
                    for (var e = this.t - 1; e >= 0; --e)
                        t[e] = this[e];
                    t.t = this.t,
                    t.s = this.s
                }
                ,
                t.prototype.fromInt = function(t) {
                    this.t = 1,
                    this.s = t < 0 ? -1 : 0,
                    t > 0 ? this[0] = t : t < -1 ? this[0] = t + this.DV : this.t = 0
                }
                ,
                t.prototype.fromString = function(e, r) {
                    var n;
                    if (16 == r)
                        n = 4;
                    else if (8 == r)
                        n = 3;
                    else if (256 == r)
                        n = 8;
                    else if (2 == r)
                        n = 1;
                    else if (32 == r)
                        n = 5;
                    else {
                        if (4 != r)
                            return void this.fromRadix(e, r);
                        n = 2
                    }
                    this.t = 0,
                    this.s = 0;
                    for (var o = e.length, i = !1, a = 0; --o >= 0; ) {
                        var s = 8 == n ? 255 & +e[o] : F(e, o);
                        s < 0 ? "-" == e.charAt(o) && (i = !0) : (i = !1,
                        0 == a ? this[this.t++] = s : a + n > this.DB ? (this[this.t - 1] |= (s & (1 << this.DB - a) - 1) << a,
                        this[this.t++] = s >> this.DB - a) : this[this.t - 1] |= s << a,
                        (a += n) >= this.DB && (a -= this.DB))
                    }
                    8 == n && 0 != (128 & +e[0]) && (this.s = -1,
                    a > 0 && (this[this.t - 1] |= (1 << this.DB - a) - 1 << a)),
                    this.clamp(),
                    i && t.ZERO.subTo(this, this)
                }
                ,
                t.prototype.clamp = function() {
                    for (var t = this.s & this.DM; this.t > 0 && this[this.t - 1] == t; )
                        --this.t
                }
                ,
                t.prototype.dlShiftTo = function(t, e) {
                    var r;
                    for (r = this.t - 1; r >= 0; --r)
                        e[r + t] = this[r];
                    for (r = t - 1; r >= 0; --r)
                        e[r] = 0;
                    e.t = this.t + t,
                    e.s = this.s
                }
                ,
                t.prototype.drShiftTo = function(t, e) {
                    for (var r = t; r < this.t; ++r)
                        e[r - t] = this[r];
                    e.t = Math.max(this.t - t, 0),
                    e.s = this.s
                }
                ,
                t.prototype.lShiftTo = function(t, e) {
                    for (var r = t % this.DB, n = this.DB - r, o = (1 << n) - 1, i = Math.floor(t / this.DB), a = this.s << r & this.DM, s = this.t - 1; s >= 0; --s)
                        e[s + i + 1] = this[s] >> n | a,
                        a = (this[s] & o) << r;
                    for (var s = i - 1; s >= 0; --s)
                        e[s] = 0;
                    e[i] = a,
                    e.t = this.t + i + 1,
                    e.s = this.s,
                    e.clamp()
                }
                ,
                t.prototype.rShiftTo = function(t, e) {
                    e.s = this.s;
                    var r = Math.floor(t / this.DB);
                    if (r >= this.t)
                        e.t = 0;
                    else {
                        var n = t % this.DB
                          , o = this.DB - n
                          , i = (1 << n) - 1;
                        e[0] = this[r] >> n;
                        for (var a = r + 1; a < this.t; ++a)
                            e[a - r - 1] |= (this[a] & i) << o,
                            e[a - r] = this[a] >> n;
                        n > 0 && (e[this.t - r - 1] |= (this.s & i) << o),
                        e.t = this.t - r,
                        e.clamp()
                    }
                }
                ,
                t.prototype.subTo = function(t, e) {
                    for (var r = 0, n = 0, o = Math.min(t.t, this.t); r < o; )
                        n += this[r] - t[r],
                        e[r++] = n & this.DM,
                        n >>= this.DB;
                    if (t.t < this.t) {
                        for (n -= t.s; r < this.t; )
                            n += this[r],
                            e[r++] = n & this.DM,
                            n >>= this.DB;
                        n += this.s
                    } else {
                        for (n += this.s; r < t.t; )
                            n -= t[r],
                            e[r++] = n & this.DM,
                            n >>= this.DB;
                        n -= t.s
                    }
                    e.s = n < 0 ? -1 : 0,
                    n < -1 ? e[r++] = this.DV + n : n > 0 && (e[r++] = n),
                    e.t = r,
                    e.clamp()
                }
                ,
                t.prototype.multiplyTo = function(e, r) {
                    var n = this.abs()
                      , o = e.abs()
                      , i = n.t;
                    for (r.t = i + o.t; --i >= 0; )
                        r[i] = 0;
                    for (i = 0; i < o.t; ++i)
                        r[i + n.t] = n.am(0, o[i], r, i, 0, n.t);
                    r.s = 0,
                    r.clamp(),
                    this.s != e.s && t.ZERO.subTo(r, r)
                }
                ,
                t.prototype.squareTo = function(t) {
                    for (var e = this.abs(), r = t.t = 2 * e.t; --r >= 0; )
                        t[r] = 0;
                    for (r = 0; r < e.t - 1; ++r) {
                        var n = e.am(r, e[r], t, 2 * r, 0, 1);
                        (t[r + e.t] += e.am(r + 1, 2 * e[r], t, 2 * r + 1, n, e.t - r - 1)) >= e.DV && (t[r + e.t] -= e.DV,
                        t[r + e.t + 1] = 1)
                    }
                    t.t > 0 && (t[t.t - 1] += e.am(r, e[r], t, 2 * r, 0, 1)),
                    t.s = 0,
                    t.clamp()
                }
                ,
                t.prototype.divRemTo = function(e, r, n) {
                    var o = e.abs();
                    if (!(o.t <= 0)) {
                        var i = this.abs();
                        if (i.t < o.t)
                            return null != r && r.fromInt(0),
                            void (null != n && this.copyTo(n));
                        null == n && (n = B());
                        var a = B()
                          , s = this.s
                          , l = e.s
                          , c = this.DB - $(o[o.t - 1]);
                        c > 0 ? (o.lShiftTo(c, a),
                        i.lShiftTo(c, n)) : (o.copyTo(a),
                        i.copyTo(n));
                        var u = a.t
                          , p = a[u - 1];
                        if (0 != p) {
                            var f = p * (1 << this.F1) + (u > 1 ? a[u - 2] >> this.F2 : 0)
                              , h = this.FV / f
                              , d = (1 << this.F1) / f
                              , g = 1 << this.F2
                              , m = n.t
                              , v = m - u
                              , b = null == r ? B() : r;
                            for (a.dlShiftTo(v, b),
                            n.compareTo(b) >= 0 && (n[n.t++] = 1,
                            n.subTo(b, n)),
                            t.ONE.dlShiftTo(u, b),
                            b.subTo(a, a); a.t < u; )
                                a[a.t++] = 0;
                            for (; --v >= 0; ) {
                                var y = n[--m] == p ? this.DM : Math.floor(n[m] * h + (n[m - 1] + g) * d);
                                if ((n[m] += a.am(0, y, n, v, 0, u)) < y)
                                    for (a.dlShiftTo(v, b),
                                    n.subTo(b, n); n[m] < --y; )
                                        n.subTo(b, n)
                            }
                            null != r && (n.drShiftTo(u, r),
                            s != l && t.ZERO.subTo(r, r)),
                            n.t = u,
                            n.clamp(),
                            c > 0 && n.rShiftTo(c, n),
                            s < 0 && t.ZERO.subTo(n, n)
                        }
                    }
                }
                ,
                t.prototype.invDigit = function() {
                    if (this.t < 1)
                        return 0;
                    var t = this[0];
                    if (0 == (1 & t))
                        return 0;
                    var e = 3 & t;
                    return (e = (e = (e = (e = e * (2 - (15 & t) * e) & 15) * (2 - (255 & t) * e) & 255) * (2 - ((65535 & t) * e & 65535)) & 65535) * (2 - t * e % this.DV) % this.DV) > 0 ? this.DV - e : -e
                }
                ,
                t.prototype.isEven = function() {
                    return 0 == (this.t > 0 ? 1 & this[0] : this.s)
                }
                ,
                t.prototype.exp = function(e, r) {
                    if (e > 4294967295 || e < 1)
                        return t.ONE;
                    var n = B()
                      , o = B()
                      , i = r.convert(this)
                      , a = $(e) - 1;
                    for (i.copyTo(n); --a >= 0; )
                        if (r.sqrTo(n, o),
                        (e & 1 << a) > 0)
                            r.mulTo(o, i, n);
                        else {
                            var s = n;
                            n = o,
                            o = s
                        }
                    return r.revert(n)
                }
                ,
                t.prototype.chunkSize = function(t) {
                    return Math.floor(Math.LN2 * this.DB / Math.log(t))
                }
                ,
                t.prototype.toRadix = function(t) {
                    if (null == t && (t = 10),
                    0 == this.signum() || t < 2 || t > 36)
                        return "0";
                    var e = this.chunkSize(t)
                      , r = Math.pow(t, e)
                      , n = V(r)
                      , o = B()
                      , i = B()
                      , a = "";
                    for (this.divRemTo(n, o, i); o.signum() > 0; )
                        a = (r + i.intValue()).toString(t).substr(1) + a,
                        o.divRemTo(n, o, i);
                    return i.intValue().toString(t) + a
                }
                ,
                t.prototype.fromRadix = function(e, r) {
                    this.fromInt(0),
                    null == r && (r = 10);
                    for (var n = this.chunkSize(r), o = Math.pow(r, n), i = !1, a = 0, s = 0, l = 0; l < e.length; ++l) {
                        var c = F(e, l);
                        c < 0 ? "-" == e.charAt(l) && 0 == this.signum() && (i = !0) : (s = r * s + c,
                        ++a >= n && (this.dMultiply(o),
                        this.dAddOffset(s, 0),
                        a = 0,
                        s = 0))
                    }
                    a > 0 && (this.dMultiply(Math.pow(r, a)),
                    this.dAddOffset(s, 0)),
                    i && t.ZERO.subTo(this, this)
                }
                ,
                t.prototype.fromNumber = function(e, r, n) {
                    if ("number" == typeof r)
                        if (e < 2)
                            this.fromInt(1);
                        else
                            for (this.fromNumber(e, n),
                            this.testBit(e - 1) || this.bitwiseTo(t.ONE.shiftLeft(e - 1), o, this),
                            this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(r); )
                                this.dAddOffset(2, 0),
                                this.bitLength() > e && this.subTo(t.ONE.shiftLeft(e - 1), this);
                    else {
                        var i = []
                          , a = 7 & e;
                        i.length = 1 + (e >> 3),
                        r.nextBytes(i),
                        a > 0 ? i[0] &= (1 << a) - 1 : i[0] = 0,
                        this.fromString(i, 256)
                    }
                }
                ,
                t.prototype.bitwiseTo = function(t, e, r) {
                    var n, o, i = Math.min(t.t, this.t);
                    for (n = 0; n < i; ++n)
                        r[n] = e(this[n], t[n]);
                    if (t.t < this.t) {
                        for (o = t.s & this.DM,
                        n = i; n < this.t; ++n)
                            r[n] = e(this[n], o);
                        r.t = this.t
                    } else {
                        for (o = this.s & this.DM,
                        n = i; n < t.t; ++n)
                            r[n] = e(o, t[n]);
                        r.t = t.t
                    }
                    r.s = e(this.s, t.s),
                    r.clamp()
                }
                ,
                t.prototype.changeBit = function(e, r) {
                    var n = t.ONE.shiftLeft(e);
                    return this.bitwiseTo(n, r, n),
                    n
                }
                ,
                t.prototype.addTo = function(t, e) {
                    for (var r = 0, n = 0, o = Math.min(t.t, this.t); r < o; )
                        n += this[r] + t[r],
                        e[r++] = n & this.DM,
                        n >>= this.DB;
                    if (t.t < this.t) {
                        for (n += t.s; r < this.t; )
                            n += this[r],
                            e[r++] = n & this.DM,
                            n >>= this.DB;
                        n += this.s
                    } else {
                        for (n += this.s; r < t.t; )
                            n += t[r],
                            e[r++] = n & this.DM,
                            n >>= this.DB;
                        n += t.s
                    }
                    e.s = n < 0 ? -1 : 0,
                    n > 0 ? e[r++] = n : n < -1 && (e[r++] = this.DV + n),
                    e.t = r,
                    e.clamp()
                }
                ,
                t.prototype.dMultiply = function(t) {
                    this[this.t] = this.am(0, t - 1, this, 0, 0, this.t),
                    ++this.t,
                    this.clamp()
                }
                ,
                t.prototype.dAddOffset = function(t, e) {
                    if (0 != t) {
                        for (; this.t <= e; )
                            this[this.t++] = 0;
                        for (this[e] += t; this[e] >= this.DV; )
                            this[e] -= this.DV,
                            ++e >= this.t && (this[this.t++] = 0),
                            ++this[e]
                    }
                }
                ,
                t.prototype.multiplyLowerTo = function(t, e, r) {
                    var n = Math.min(this.t + t.t, e);
                    for (r.s = 0,
                    r.t = n; n > 0; )
                        r[--n] = 0;
                    for (var o = r.t - this.t; n < o; ++n)
                        r[n + this.t] = this.am(0, t[n], r, n, 0, this.t);
                    for (var o = Math.min(t.t, e); n < o; ++n)
                        this.am(0, t[n], r, n, 0, e - n);
                    r.clamp()
                }
                ,
                t.prototype.multiplyUpperTo = function(t, e, r) {
                    --e;
                    var n = r.t = this.t + t.t - e;
                    for (r.s = 0; --n >= 0; )
                        r[n] = 0;
                    for (n = Math.max(e - this.t, 0); n < t.t; ++n)
                        r[this.t + n - e] = this.am(e - n, t[n], r, 0, 0, this.t + n - e);
                    r.clamp(),
                    r.drShiftTo(1, r)
                }
                ,
                t.prototype.modInt = function(t) {
                    if (t <= 0)
                        return 0;
                    var e = this.DV % t
                      , r = this.s < 0 ? t - 1 : 0;
                    if (this.t > 0)
                        if (0 == e)
                            r = this[0] % t;
                        else
                            for (var n = this.t - 1; n >= 0; --n)
                                r = (e * r + this[n]) % t;
                    return r
                }
                ,
                t.prototype.millerRabin = function(e) {
                    var r = this.subtract(t.ONE)
                      , n = r.getLowestSetBit();
                    if (n <= 0)
                        return !1;
                    var o = r.shiftRight(n);
                    (e = e + 1 >> 1) > T.length && (e = T.length);
                    for (var i = B(), a = 0; a < e; ++a) {
                        i.fromInt(T[Math.floor(Math.random() * T.length)]);
                        var s = i.modPow(o, this);
                        if (0 != s.compareTo(t.ONE) && 0 != s.compareTo(r)) {
                            for (var l = 1; l++ < n && 0 != s.compareTo(r); )
                                if (0 == (s = s.modPowInt(2, this)).compareTo(t.ONE))
                                    return !1;
                            if (0 != s.compareTo(r))
                                return !1
                        }
                    }
                    return !0
                }
                ,
                t.prototype.square = function() {
                    var t = B();
                    return this.squareTo(t),
                    t
                }
                ,
                t.prototype.gcda = function(t, e) {
                    var r = this.s < 0 ? this.negate() : this.clone()
                      , n = t.s < 0 ? t.negate() : t.clone();
                    if (r.compareTo(n) < 0) {
                        var o = r;
                        r = n,
                        n = o
                    }
                    var i = r.getLowestSetBit()
                      , a = n.getLowestSetBit();
                    if (a < 0)
                        e(r);
                    else {
                        i < a && (a = i),
                        a > 0 && (r.rShiftTo(a, r),
                        n.rShiftTo(a, n));
                        var s = function() {
                            (i = r.getLowestSetBit()) > 0 && r.rShiftTo(i, r),
                            (i = n.getLowestSetBit()) > 0 && n.rShiftTo(i, n),
                            r.compareTo(n) >= 0 ? (r.subTo(n, r),
                            r.rShiftTo(1, r)) : (n.subTo(r, n),
                            n.rShiftTo(1, n)),
                            r.signum() > 0 ? setTimeout(s, 0) : (a > 0 && n.lShiftTo(a, n),
                            setTimeout(function() {
                                e(n)
                            }, 0))
                        };
                        setTimeout(s, 10)
                    }
                }
                ,
                t.prototype.fromNumberAsync = function(e, r, n, i) {
                    if ("number" == typeof r)
                        if (e < 2)
                            this.fromInt(1);
                        else {
                            this.fromNumber(e, n),
                            this.testBit(e - 1) || this.bitwiseTo(t.ONE.shiftLeft(e - 1), o, this),
                            this.isEven() && this.dAddOffset(1, 0);
                            var a = this
                              , s = function() {
                                a.dAddOffset(2, 0),
                                a.bitLength() > e && a.subTo(t.ONE.shiftLeft(e - 1), a),
                                a.isProbablePrime(r) ? setTimeout(function() {
                                    i()
                                }, 0) : setTimeout(s, 0)
                            };
                            setTimeout(s, 0)
                        }
                    else {
                        var l = []
                          , c = 7 & e;
                        l.length = 1 + (e >> 3),
                        r.nextBytes(l),
                        c > 0 ? l[0] &= (1 << c) - 1 : l[0] = 0,
                        this.fromString(l, 256)
                    }
                }
                ,
                t
            }(), j = function() {
                function t() {}
                return t.prototype.convert = function(t) {
                    return t
                }
                ,
                t.prototype.revert = function(t) {
                    return t
                }
                ,
                t.prototype.mulTo = function(t, e, r) {
                    t.multiplyTo(e, r)
                }
                ,
                t.prototype.sqrTo = function(t, e) {
                    t.squareTo(e)
                }
                ,
                t
            }(), k = function() {
                function t(t) {
                    this.m = t
                }
                return t.prototype.convert = function(t) {
                    return t.s < 0 || t.compareTo(this.m) >= 0 ? t.mod(this.m) : t
                }
                ,
                t.prototype.revert = function(t) {
                    return t
                }
                ,
                t.prototype.reduce = function(t) {
                    t.divRemTo(this.m, null, t)
                }
                ,
                t.prototype.mulTo = function(t, e, r) {
                    t.multiplyTo(e, r),
                    this.reduce(r)
                }
                ,
                t.prototype.sqrTo = function(t, e) {
                    t.squareTo(e),
                    this.reduce(e)
                }
                ,
                t
            }(), D = function() {
                function t(t) {
                    this.m = t,
                    this.mp = t.invDigit(),
                    this.mpl = 32767 & this.mp,
                    this.mph = this.mp >> 15,
                    this.um = (1 << t.DB - 15) - 1,
                    this.mt2 = 2 * t.t
                }
                return t.prototype.convert = function(t) {
                    var e = B();
                    return t.abs().dlShiftTo(this.m.t, e),
                    e.divRemTo(this.m, null, e),
                    t.s < 0 && e.compareTo(R.ZERO) > 0 && this.m.subTo(e, e),
                    e
                }
                ,
                t.prototype.revert = function(t) {
                    var e = B();
                    return t.copyTo(e),
                    this.reduce(e),
                    e
                }
                ,
                t.prototype.reduce = function(t) {
                    for (; t.t <= this.mt2; )
                        t[t.t++] = 0;
                    for (var e = 0; e < this.m.t; ++e) {
                        var r = 32767 & t[e]
                          , n = r * this.mpl + ((r * this.mph + (t[e] >> 15) * this.mpl & this.um) << 15) & t.DM;
                        for (r = e + this.m.t,
                        t[r] += this.m.am(0, n, t, e, 0, this.m.t); t[r] >= t.DV; )
                            t[r] -= t.DV,
                            t[++r]++
                    }
                    t.clamp(),
                    t.drShiftTo(this.m.t, t),
                    t.compareTo(this.m) >= 0 && t.subTo(this.m, t)
                }
                ,
                t.prototype.mulTo = function(t, e, r) {
                    t.multiplyTo(e, r),
                    this.reduce(r)
                }
                ,
                t.prototype.sqrTo = function(t, e) {
                    t.squareTo(e),
                    this.reduce(e)
                }
                ,
                t
            }(), P = function() {
                function t(t) {
                    this.m = t,
                    this.r2 = B(),
                    this.q3 = B(),
                    R.ONE.dlShiftTo(2 * t.t, this.r2),
                    this.mu = this.r2.divide(t)
                }
                return t.prototype.convert = function(t) {
                    if (t.s < 0 || t.t > 2 * this.m.t)
                        return t.mod(this.m);
                    if (t.compareTo(this.m) < 0)
                        return t;
                    var e = B();
                    return t.copyTo(e),
                    this.reduce(e),
                    e
                }
                ,
                t.prototype.revert = function(t) {
                    return t
                }
                ,
                t.prototype.reduce = function(t) {
                    for (t.drShiftTo(this.m.t - 1, this.r2),
                    t.t > this.m.t + 1 && (t.t = this.m.t + 1,
                    t.clamp()),
                    this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3),
                    this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); t.compareTo(this.r2) < 0; )
                        t.dAddOffset(1, this.m.t + 1);
                    for (t.subTo(this.r2, t); t.compareTo(this.m) >= 0; )
                        t.subTo(this.m, t)
                }
                ,
                t.prototype.mulTo = function(t, e, r) {
                    t.multiplyTo(e, r),
                    this.reduce(r)
                }
                ,
                t.prototype.sqrTo = function(t, e) {
                    t.squareTo(e),
                    this.reduce(e)
                }
                ,
                t
            }();
            function B() {
                return new R(null)
            }
            function N(t, e) {
                return new R(t,e)
            }
            "Microsoft Internet Explorer" == navigator.appName ? (R.prototype.am = function(t, e, r, n, o, i) {
                for (var a = 32767 & e, s = e >> 15; --i >= 0; ) {
                    var l = 32767 & this[t]
                      , c = this[t++] >> 15
                      , u = s * l + c * a;
                    l = a * l + ((32767 & u) << 15) + r[n] + (1073741823 & o),
                    o = (l >>> 30) + (u >>> 15) + s * c + (o >>> 30),
                    r[n++] = 1073741823 & l
                }
                return o
            }
            ,
            C = 30) : "Netscape" != navigator.appName ? (R.prototype.am = function(t, e, r, n, o, i) {
                for (; --i >= 0; ) {
                    var a = e * this[t++] + r[n] + o;
                    o = Math.floor(a / 67108864),
                    r[n++] = 67108863 & a
                }
                return o
            }
            ,
            C = 26) : (R.prototype.am = function(t, e, r, n, o, i) {
                for (var a = 16383 & e, s = e >> 14; --i >= 0; ) {
                    var l = 16383 & this[t]
                      , c = this[t++] >> 14
                      , u = s * l + c * a;
                    l = a * l + ((16383 & u) << 14) + r[n] + o,
                    o = (l >> 28) + (u >> 14) + s * c,
                    r[n++] = 268435455 & l
                }
                return o
            }
            ,
            C = 28),
            R.prototype.DB = C,
            R.prototype.DM = (1 << C) - 1,
            R.prototype.DV = 1 << C,
            R.prototype.FV = Math.pow(2, 52),
            R.prototype.F1 = 52 - C,
            R.prototype.F2 = 2 * C - 52;
            var M, _, L = [];
            for (M = "0".charCodeAt(0),
            _ = 0; _ <= 9; ++_)
                L[M++] = _;
            for (M = "a".charCodeAt(0),
            _ = 10; _ < 36; ++_)
                L[M++] = _;
            for (M = "A".charCodeAt(0),
            _ = 10; _ < 36; ++_)
                L[M++] = _;
            function F(t, e) {
                var r = L[t.charCodeAt(e)];
                return null == r ? -1 : r
            }
            function V(t) {
                var e = B();
                return e.fromInt(t),
                e
            }
            function $(t) {
                var e, r = 1;
                return 0 != (e = t >>> 16) && (t = e,
                r += 16),
                0 != (e = t >> 8) && (t = e,
                r += 8),
                0 != (e = t >> 4) && (t = e,
                r += 4),
                0 != (e = t >> 2) && (t = e,
                r += 2),
                0 != (e = t >> 1) && (t = e,
                r += 1),
                r
            }
            R.ZERO = V(0),
            R.ONE = V(1);
            var W, z, H = function() {
                function t() {
                    this.i = 0,
                    this.j = 0,
                    this.S = []
                }
                return t.prototype.init = function(t) {
                    var e, r, n;
                    for (e = 0; e < 256; ++e)
                        this.S[e] = e;
                    for (r = 0,
                    e = 0; e < 256; ++e)
                        r = r + this.S[e] + t[e % t.length] & 255,
                        n = this.S[e],
                        this.S[e] = this.S[r],
                        this.S[r] = n;
                    this.i = 0,
                    this.j = 0
                }
                ,
                t.prototype.next = function() {
                    var t;
                    return this.i = this.i + 1 & 255,
                    this.j = this.j + this.S[this.i] & 255,
                    t = this.S[this.i],
                    this.S[this.i] = this.S[this.j],
                    this.S[this.j] = t,
                    this.S[t + this.S[this.i] & 255]
                }
                ,
                t
            }(), U = 256, q = null;
            if (null == q) {
                q = [],
                z = 0;
                var K = void 0;
                if (window.crypto && window.crypto.getRandomValues) {
                    var G = new Uint32Array(256);
                    for (window.crypto.getRandomValues(G),
                    K = 0; K < G.length; ++K)
                        q[z++] = 255 & G[K]
                }
                var Y = function(t) {
                    if (this.count = this.count || 0,
                    this.count >= 256 || z >= U)
                        window.removeEventListener ? window.removeEventListener("mousemove", Y, !1) : window.detachEvent && window.detachEvent("onmousemove", Y);
                    else
                        try {
                            var e = t.x + t.y;
                            q[z++] = 255 & e,
                            this.count += 1
                        } catch (t) {}
                };
                window.addEventListener ? window.addEventListener("mousemove", Y, !1) : window.attachEvent && window.attachEvent("onmousemove", Y)
            }
            function J() {
                if (null == W) {
                    for (W = new H; z < U; ) {
                        var t = Math.floor(65536 * Math.random());
                        q[z++] = 255 & t
                    }
                    for (W.init(q),
                    z = 0; z < q.length; ++z)
                        q[z] = 0;
                    z = 0
                }
                return W.next()
            }
            var Z = function() {
                function t() {}
                return t.prototype.nextBytes = function(t) {
                    for (var e = 0; e < t.length; ++e)
                        t[e] = J()
                }
                ,
                t
            }()
              , X = function() {
                function t() {
                    this.n = null,
                    this.e = 0,
                    this.d = null,
                    this.p = null,
                    this.q = null,
                    this.dmp1 = null,
                    this.dmq1 = null,
                    this.coeff = null
                }
                return t.prototype.doPublic = function(t) {
                    return t.modPowInt(this.e, this.n)
                }
                ,
                t.prototype.doPrivate = function(t) {
                    if (null == this.p || null == this.q)
                        return t.modPow(this.d, this.n);
                    for (var e = t.mod(this.p).modPow(this.dmp1, this.p), r = t.mod(this.q).modPow(this.dmq1, this.q); e.compareTo(r) < 0; )
                        e = e.add(this.p);
                    return e.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)
                }
                ,
                t.prototype.setPublic = function(t, e) {
                    null != t && null != e && t.length > 0 && e.length > 0 ? (this.n = N(t, 16),
                    this.e = parseInt(e, 16)) : console.error("Invalid RSA public key")
                }
                ,
                t.prototype.encrypt = function(t) {
                    var e = function(t, e) {
                        if (e < t.length + 11)
                            return console.error("Message too long for RSA"),
                            null;
                        for (var r = [], n = t.length - 1; n >= 0 && e > 0; ) {
                            var o = t.charCodeAt(n--);
                            o < 128 ? r[--e] = o : o > 127 && o < 2048 ? (r[--e] = 63 & o | 128,
                            r[--e] = o >> 6 | 192) : (r[--e] = 63 & o | 128,
                            r[--e] = o >> 6 & 63 | 128,
                            r[--e] = o >> 12 | 224)
                        }
                        r[--e] = 0;
                        for (var i = new Z, a = []; e > 2; ) {
                            for (a[0] = 0; 0 == a[0]; )
                                i.nextBytes(a);
                            r[--e] = a[0]
                        }
                        return r[--e] = 2,
                        r[--e] = 0,
                        new R(r)
                    }(t, this.n.bitLength() + 7 >> 3);
                    if (null == e)
                        return null;
                    var r = this.doPublic(e);
                    if (null == r)
                        return null;
                    var n = r.toString(16);
                    return 0 == (1 & n.length) ? n : "0" + n
                }
                ,
                t.prototype.setPrivate = function(t, e, r) {
                    null != t && null != e && t.length > 0 && e.length > 0 ? (this.n = N(t, 16),
                    this.e = parseInt(e, 16),
                    this.d = N(r, 16)) : console.error("Invalid RSA private key")
                }
                ,
                t.prototype.setPrivateEx = function(t, e, r, n, o, i, a, s) {
                    null != t && null != e && t.length > 0 && e.length > 0 ? (this.n = N(t, 16),
                    this.e = parseInt(e, 16),
                    this.d = N(r, 16),
                    this.p = N(n, 16),
                    this.q = N(o, 16),
                    this.dmp1 = N(i, 16),
                    this.dmq1 = N(a, 16),
                    this.coeff = N(s, 16)) : console.error("Invalid RSA private key")
                }
                ,
                t.prototype.generate = function(t, e) {
                    var r = new Z
                      , n = t >> 1;
                    this.e = parseInt(e, 16);
                    for (var o = new R(e,16); ; ) {
                        for (; this.p = new R(t - n,1,r),
                        0 != this.p.subtract(R.ONE).gcd(o).compareTo(R.ONE) || !this.p.isProbablePrime(10); )
                            ;
                        for (; this.q = new R(n,1,r),
                        0 != this.q.subtract(R.ONE).gcd(o).compareTo(R.ONE) || !this.q.isProbablePrime(10); )
                            ;
                        if (this.p.compareTo(this.q) <= 0) {
                            var i = this.p;
                            this.p = this.q,
                            this.q = i
                        }
                        var a = this.p.subtract(R.ONE)
                          , s = this.q.subtract(R.ONE)
                          , l = a.multiply(s);
                        if (0 == l.gcd(o).compareTo(R.ONE)) {
                            this.n = this.p.multiply(this.q),
                            this.d = o.modInverse(l),
                            this.dmp1 = this.d.mod(a),
                            this.dmq1 = this.d.mod(s),
                            this.coeff = this.q.modInverse(this.p);
                            break
                        }
                    }
                }
                ,
                t.prototype.decrypt = function(t) {
                    var e = N(t, 16)
                      , r = this.doPrivate(e);
                    return null == r ? null : function(t, e) {
                        for (var r = t.toByteArray(), n = 0; n < r.length && 0 == r[n]; )
                            ++n;
                        if (r.length - n != e - 1 || 2 != r[n])
                            return null;
                        for (++n; 0 != r[n]; )
                            if (++n >= r.length)
                                return null;
                        for (var o = ""; ++n < r.length; ) {
                            var i = 255 & r[n];
                            i < 128 ? o += String.fromCharCode(i) : i > 191 && i < 224 ? (o += String.fromCharCode((31 & i) << 6 | 63 & r[n + 1]),
                            ++n) : (o += String.fromCharCode((15 & i) << 12 | (63 & r[n + 1]) << 6 | 63 & r[n + 2]),
                            n += 2)
                        }
                        return o
                    }(r, this.n.bitLength() + 7 >> 3)
                }
                ,
                t.prototype.generateAsync = function(t, e, r) {
                    var n = new Z
                      , o = t >> 1;
                    this.e = parseInt(e, 16);
                    var i = new R(e,16)
                      , a = this
                      , s = function() {
                        var e = function() {
                            if (a.p.compareTo(a.q) <= 0) {
                                var t = a.p;
                                a.p = a.q,
                                a.q = t
                            }
                            var e = a.p.subtract(R.ONE)
                              , n = a.q.subtract(R.ONE)
                              , o = e.multiply(n);
                            0 == o.gcd(i).compareTo(R.ONE) ? (a.n = a.p.multiply(a.q),
                            a.d = i.modInverse(o),
                            a.dmp1 = a.d.mod(e),
                            a.dmq1 = a.d.mod(n),
                            a.coeff = a.q.modInverse(a.p),
                            setTimeout(function() {
                                r()
                            }, 0)) : setTimeout(s, 0)
                        }
                          , l = function() {
                            a.q = B(),
                            a.q.fromNumberAsync(o, 1, n, function() {
                                a.q.subtract(R.ONE).gcda(i, function(t) {
                                    0 == t.compareTo(R.ONE) && a.q.isProbablePrime(10) ? setTimeout(e, 0) : setTimeout(l, 0)
                                })
                            })
                        }
                          , c = function() {
                            a.p = B(),
                            a.p.fromNumberAsync(t - o, 1, n, function() {
                                a.p.subtract(R.ONE).gcda(i, function(t) {
                                    0 == t.compareTo(R.ONE) && a.p.isProbablePrime(10) ? setTimeout(l, 0) : setTimeout(c, 0)
                                })
                            })
                        };
                        setTimeout(c, 0)
                    };
                    setTimeout(s, 0)
                }
                ,
                t.prototype.sign = function(t, e, r) {
                    var n = function(t) {
                        return Q[t] || ""
                    }(r)
                      , o = n + e(t).toString()
                      , i = function(t, e) {
                        if (e < t.length + 22)
                            return console.error("Message too long for RSA"),
                            null;
                        for (var r = e - t.length - 6, n = "", o = 0; o < r; o += 2)
                            n += "ff";
                        return N("0001" + n + "00" + t, 16)
                    }(o, this.n.bitLength() / 4);
                    if (null == i)
                        return null;
                    var a = this.doPrivate(i);
                    if (null == a)
                        return null;
                    var s = a.toString(16);
                    return 0 == (1 & s.length) ? s : "0" + s
                }
                ,
                t.prototype.verify = function(t, e, r) {
                    var n = N(e, 16)
                      , o = this.doPublic(n);
                    if (null == o)
                        return null;
                    var i = o.toString(16).replace(/^1f+00/, "")
                      , a = function(t) {
                        for (var e in Q)
                            if (Q.hasOwnProperty(e)) {
                                var r = Q[e]
                                  , n = r.length;
                                if (t.substr(0, n) == r)
                                    return t.substr(n)
                            }
                        return t
                    }/*!
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
                    (i);
                    return a == r(t).toString()
                }
                ,
                t
            }()
              , Q = {
                md2: "3020300c06082a864886f70d020205000410",
                md5: "3020300c06082a864886f70d020505000410",
                sha1: "3021300906052b0e03021a05000414",
                sha224: "302d300d06096086480165030402040500041c",
                sha256: "3031300d060960864801650304020105000420",
                sha384: "3041300d060960864801650304020205000430",
                sha512: "3051300d060960864801650304020305000440",
                ripemd160: "3021300906052b2403020105000414"
            }
              , tt = {};
            tt.lang = {
                extend: function(t, e, r) {
                    if (!e || !t)
                        throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");
                    var n = function() {};
                    if (n.prototype = e.prototype,
                    t.prototype = new n,
                    t.prototype.constructor = t,
                    t.superclass = e.prototype,
                    e.prototype.constructor == Object.prototype.constructor && (e.prototype.constructor = e),
                    r) {
                        var o;
                        for (o in r)
                            t.prototype[o] = r[o];
                        var i = function() {}
                          , a = ["toString", "valueOf"];
                        try {
                            /MSIE/.test(navigator.userAgent) && (i = function(t, e) {
                                for (o = 0; o < a.length; o += 1) {
                                    var r = a[o]
                                      , n = e[r];
                                    "function" == typeof n && n != Object.prototype[r] && (t[r] = n)
                                }
                            }
                            )
                        } catch (t) {}
                        i(t.prototype, r)
                    }
                }
            };
            /**
 * @fileOverview
 * @name asn1-1.0.js
 * @author Kenji Urushima kenji.urushima@gmail.com
 * @version asn1 1.0.13 (2017-Jun-02)
 * @since jsrsasign 2.1
 * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
 */
            var et = {};
            void 0 !== et.asn1 && et.asn1 || (et.asn1 = {}),
            et.asn1.ASN1Util = new function() {
                this.integerToByteHex = function(t) {
                    var e = t.toString(16);
                    return e.length % 2 == 1 && (e = "0" + e),
                    e
                }
                ,
                this.bigIntToMinTwosComplementsHex = function(t) {
                    var e = t.toString(16);
                    if ("-" != e.substr(0, 1))
                        e.length % 2 == 1 ? e = "0" + e : e.match(/^[0-7]/) || (e = "00" + e);
                    else {
                        var r = e.substr(1)
                          , n = r.length;
                        n % 2 == 1 ? n += 1 : e.match(/^[0-7]/) || (n += 2);
                        for (var o = "", i = 0; i < n; i++)
                            o += "f";
                        var a = new R(o,16)
                          , s = a.xor(t).add(R.ONE);
                        e = s.toString(16).replace(/^-/, "")
                    }
                    return e
                }
                ,
                this.getPEMStringFromHex = function(t, e) {
                    return hextopem(t, e)
                }
                ,
                this.newObject = function(t) {
                    var e = et
                      , r = e.asn1
                      , n = r.DERBoolean
                      , o = r.DERInteger
                      , i = r.DERBitString
                      , a = r.DEROctetString
                      , s = r.DERNull
                      , l = r.DERObjectIdentifier
                      , c = r.DEREnumerated
                      , u = r.DERUTF8String
                      , p = r.DERNumericString
                      , f = r.DERPrintableString
                      , h = r.DERTeletexString
                      , d = r.DERIA5String
                      , g = r.DERUTCTime
                      , m = r.DERGeneralizedTime
                      , v = r.DERSequence
                      , b = r.DERSet
                      , y = r.DERTaggedObject
                      , w = r.ASN1Util.newObject
                      , S = Object.keys(t);
                    if (1 != S.length)
                        throw "key of param shall be only one.";
                    var x = S[0];
                    if (-1 == ":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + x + ":"))
                        throw "undefined key: " + x;
                    if ("bool" == x)
                        return new n(t[x]);
                    if ("int" == x)
                        return new o(t[x]);
                    if ("bitstr" == x)
                        return new i(t[x]);
                    if ("octstr" == x)
                        return new a(t[x]);
                    if ("null" == x)
                        return new s(t[x]);
                    if ("oid" == x)
                        return new l(t[x]);
                    if ("enum" == x)
                        return new c(t[x]);
                    if ("utf8str" == x)
                        return new u(t[x]);
                    if ("numstr" == x)
                        return new p(t[x]);
                    if ("prnstr" == x)
                        return new f(t[x]);
                    if ("telstr" == x)
                        return new h(t[x]);
                    if ("ia5str" == x)
                        return new d(t[x]);
                    if ("utctime" == x)
                        return new g(t[x]);
                    if ("gentime" == x)
                        return new m(t[x]);
                    if ("seq" == x) {
                        for (var C = t[x], E = [], O = 0; O < C.length; O++) {
                            var I = w(C[O]);
                            E.push(I)
                        }
                        return new v({
                            array: E
                        })
                    }
                    if ("set" == x) {
                        for (var C = t[x], E = [], O = 0; O < C.length; O++) {
                            var I = w(C[O]);
                            E.push(I)
                        }
                        return new b({
                            array: E
                        })
                    }
                    if ("tag" == x) {
                        var T = t[x];
                        if ("[object Array]" === Object.prototype.toString.call(T) && 3 == T.length) {
                            var A = w(T[2]);
                            return new y({
                                tag: T[0],
                                explicit: T[1],
                                obj: A
                            })
                        }
                        var R = {};
                        if (void 0 !== T.explicit && (R.explicit = T.explicit),
                        void 0 !== T.tag && (R.tag = T.tag),
                        void 0 === T.obj)
                            throw "obj shall be specified for 'tag'.";
                        return R.obj = w(T.obj),
                        new y(R)
                    }
                }
                ,
                this.jsonToASN1HEX = function(t) {
                    var e = this.newObject(t);
                    return e.getEncodedHex()
                }
            }
            ,
            et.asn1.ASN1Util.oidHexToInt = function(t) {
                for (var e = "", r = parseInt(t.substr(0, 2), 16), n = Math.floor(r / 40), o = r % 40, e = n + "." + o, i = "", a = 2; a < t.length; a += 2) {
                    var s = parseInt(t.substr(a, 2), 16)
                      , l = ("00000000" + s.toString(2)).slice(-8);
                    if (i += l.substr(1, 7),
                    "0" == l.substr(0, 1)) {
                        var c = new R(i,2);
                        e = e + "." + c.toString(10),
                        i = ""
                    }
                }
                return e
            }
            ,
            et.asn1.ASN1Util.oidIntToHex = function(t) {
                var e = function(t) {
                    var e = t.toString(16);
                    return 1 == e.length && (e = "0" + e),
                    e
                }
                  , r = function(t) {
                    var r = ""
                      , n = new R(t,10)
                      , o = n.toString(2)
                      , i = 7 - o.length % 7;
                    7 == i && (i = 0);
                    for (var a = "", s = 0; s < i; s++)
                        a += "0";
                    o = a + o;
                    for (var s = 0; s < o.length - 1; s += 7) {
                        var l = o.substr(s, 7);
                        s != o.length - 7 && (l = "1" + l),
                        r += e(parseInt(l, 2))
                    }
                    return r
                };
                if (!t.match(/^[0-9.]+$/))
                    throw "malformed oid string: " + t;
                var n = ""
                  , o = t.split(".")
                  , i = 40 * parseInt(o[0]) + parseInt(o[1]);
                n += e(i),
                o.splice(0, 2);
                for (var a = 0; a < o.length; a++)
                    n += r(o[a]);
                return n
            }
            ,
            et.asn1.ASN1Object = function() {
                this.getLengthHexFromValue = function() {
                    if (void 0 === this.hV || null == this.hV)
                        throw "this.hV is null or undefined.";
                    if (this.hV.length % 2 == 1)
                        throw "value hex must be even length: n=" + "".length + ",v=" + this.hV;
                    var t = this.hV.length / 2
                      , e = t.toString(16);
                    if (e.length % 2 == 1 && (e = "0" + e),
                    t < 128)
                        return e;
                    var r = e.length / 2;
                    if (r > 15)
                        throw "ASN.1 length too long to represent by 8x: n = " + t.toString(16);
                    var n = 128 + r;
                    return n.toString(16) + e
                }
                ,
                this.getEncodedHex = function() {
                    return (null == this.hTLV || this.isModified) && (this.hV = this.getFreshValueHex(),
                    this.hL = this.getLengthHexFromValue(),
                    this.hTLV = this.hT + this.hL + this.hV,
                    this.isModified = !1),
                    this.hTLV
                }
                ,
                this.getValueHex = function() {
                    return this.getEncodedHex(),
                    this.hV
                }
                ,
                this.getFreshValueHex = function() {
                    return ""
                }
            }
            ,
            et.asn1.DERAbstractString = function(t) {
                et.asn1.DERAbstractString.superclass.constructor.call(this),
                this.getString = function() {
                    return this.s
                }
                ,
                this.setString = function(t) {
                    this.hTLV = null,
                    this.isModified = !0,
                    this.s = t,
                    this.hV = stohex(this.s)
                }
                ,
                this.setStringHex = function(t) {
                    this.hTLV = null,
                    this.isModified = !0,
                    this.s = null,
                    this.hV = t
                }
                ,
                this.getFreshValueHex = function() {
                    return this.hV
                }
                ,
                void 0 !== t && ("string" == typeof t ? this.setString(t) : void 0 !== t.str ? this.setString(t.str) : void 0 !== t.hex && this.setStringHex(t.hex))
            }
            ,
            tt.lang.extend(et.asn1.DERAbstractString, et.asn1.ASN1Object),
            et.asn1.DERAbstractTime = function(t) {
                et.asn1.DERAbstractTime.superclass.constructor.call(this),
                this.localDateToUTC = function(t) {
                    utc = t.getTime() + 6e4 * t.getTimezoneOffset();
                    var e = new Date(utc);
                    return e
                }
                ,
                this.formatDate = function(t, e, r) {
                    var n = this.zeroPadding
                      , o = this.localDateToUTC(t)
                      , i = String(o.getFullYear());
                    "utc" == e && (i = i.substr(2, 2));
                    var a = n(String(o.getMonth() + 1), 2)
                      , s = n(String(o.getDate()), 2)
                      , l = n(String(o.getHours()), 2)
                      , c = n(String(o.getMinutes()), 2)
                      , u = n(String(o.getSeconds()), 2)
                      , p = i + a + s + l + c + u;
                    if (!0 === r) {
                        var f = o.getMilliseconds();
                        if (0 != f) {
                            var h = n(String(f), 3);
                            h = h.replace(/[0]+$/, ""),
                            p = p + "." + h
                        }
                    }
                    return p + "Z"
                }
                ,
                this.zeroPadding = function(t, e) {
                    return t.length >= e ? t : new Array(e - t.length + 1).join("0") + t
                }
                ,
                this.getString = function() {
                    return this.s
                }
                ,
                this.setString = function(t) {
                    this.hTLV = null,
                    this.isModified = !0,
                    this.s = t,
                    this.hV = stohex(t)
                }
                ,
                this.setByDateValue = function(t, e, r, n, o, i) {
                    var a = new Date(Date.UTC(t, e - 1, r, n, o, i, 0));
                    this.setByDate(a)
                }
                ,
                this.getFreshValueHex = function() {
                    return this.hV
                }
            }
            ,
            tt.lang.extend(et.asn1.DERAbstractTime, et.asn1.ASN1Object),
            et.asn1.DERAbstractStructured = function(t) {
                et.asn1.DERAbstractString.superclass.constructor.call(this),
                this.setByASN1ObjectArray = function(t) {
                    this.hTLV = null,
                    this.isModified = !0,
                    this.asn1Array = t
                }
                ,
                this.appendASN1Object = function(t) {
                    this.hTLV = null,
                    this.isModified = !0,
                    this.asn1Array.push(t)
                }
                ,
                this.asn1Array = new Array,
                void 0 !== t && void 0 !== t.array && (this.asn1Array = t.array)
            }
            ,
            tt.lang.extend(et.asn1.DERAbstractStructured, et.asn1.ASN1Object),
            et.asn1.DERBoolean = function() {
                et.asn1.DERBoolean.superclass.constructor.call(this),
                this.hT = "01",
                this.hTLV = "0101ff"
            }
            ,
            tt.lang.extend(et.asn1.DERBoolean, et.asn1.ASN1Object),
            et.asn1.DERInteger = function(t) {
                et.asn1.DERInteger.superclass.constructor.call(this),
                this.hT = "02",
                this.setByBigInteger = function(t) {
                    this.hTLV = null,
                    this.isModified = !0,
                    this.hV = et.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)
                }
                ,
                this.setByInteger = function(t) {
                    var e = new R(String(t),10);
                    this.setByBigInteger(e)
                }
                ,
                this.setValueHex = function(t) {
                    this.hV = t
                }
                ,
                this.getFreshValueHex = function() {
                    return this.hV
                }
                ,
                void 0 !== t && (void 0 !== t.bigint ? this.setByBigInteger(t.bigint) : void 0 !== t.int ? this.setByInteger(t.int) : "number" == typeof t ? this.setByInteger(t) : void 0 !== t.hex && this.setValueHex(t.hex))
            }
            ,
            tt.lang.extend(et.asn1.DERInteger, et.asn1.ASN1Object),
            et.asn1.DERBitString = function(t) {
                if (void 0 !== t && void 0 !== t.obj) {
                    var e = et.asn1.ASN1Util.newObject(t.obj);
                    t.hex = "00" + e.getEncodedHex()
                }
                et.asn1.DERBitString.superclass.constructor.call(this),
                this.hT = "03",
                this.setHexValueIncludingUnusedBits = function(t) {
                    this.hTLV = null,
                    this.isModified = !0,
                    this.hV = t
                }
                ,
                this.setUnusedBitsAndHexValue = function(t, e) {
                    if (t < 0 || 7 < t)
                        throw "unused bits shall be from 0 to 7: u = " + t;
                    var r = "0" + t;
                    this.hTLV = null,
                    this.isModified = !0,
                    this.hV = r + e
                }
                ,
                this.setByBinaryString = function(t) {
                    var e = 8 - (t = t.replace(/0+$/, "")).length % 8;
                    8 == e && (e = 0);
                    for (var r = 0; r <= e; r++)
                        t += "0";
                    for (var n = "", r = 0; r < t.length - 1; r += 8) {
                        var o = t.substr(r, 8)
                          , i = parseInt(o, 2).toString(16);
                        1 == i.length && (i = "0" + i),
                        n += i
                    }
                    this.hTLV = null,
                    this.isModified = !0,
                    this.hV = "0" + e + n
                }
                ,
                this.setByBooleanArray = function(t) {
                    for (var e = "", r = 0; r < t.length; r++)
                        1 == t[r] ? e += "1" : e += "0";
                    this.setByBinaryString(e)
                }
                ,
                this.newFalseArray = function(t) {
                    for (var e = new Array(t), r = 0; r < t; r++)
                        e[r] = !1;
                    return e
                }
                ,
                this.getFreshValueHex = function() {
                    return this.hV
                }
                ,
                void 0 !== t && ("string" == typeof t && t.toLowerCase().match(/^[0-9a-f]+$/) ? this.setHexValueIncludingUnusedBits(t) : void 0 !== t.hex ? this.setHexValueIncludingUnusedBits(t.hex) : void 0 !== t.bin ? this.setByBinaryString(t.bin) : void 0 !== t.array && this.setByBooleanArray(t.array))
            }
            ,
            tt.lang.extend(et.asn1.DERBitString, et.asn1.ASN1Object),
            et.asn1.DEROctetString = function(t) {
                if (void 0 !== t && void 0 !== t.obj) {
                    var e = et.asn1.ASN1Util.newObject(t.obj);
                    t.hex = e.getEncodedHex()
                }
                et.asn1.DEROctetString.superclass.constructor.call(this, t),
                this.hT = "04"
            }
            ,
            tt.lang.extend(et.asn1.DEROctetString, et.asn1.DERAbstractString),
            et.asn1.DERNull = function() {
                et.asn1.DERNull.superclass.constructor.call(this),
                this.hT = "05",
                this.hTLV = "0500"
            }
            ,
            tt.lang.extend(et.asn1.DERNull, et.asn1.ASN1Object),
            et.asn1.DERObjectIdentifier = function(t) {
                var e = function(t) {
                    var e = t.toString(16);
                    return 1 == e.length && (e = "0" + e),
                    e
                }
                  , r = function(t) {
                    var r = ""
                      , n = new R(t,10)
                      , o = n.toString(2)
                      , i = 7 - o.length % 7;
                    7 == i && (i = 0);
                    for (var a = "", s = 0; s < i; s++)
                        a += "0";
                    o = a + o;
                    for (var s = 0; s < o.length - 1; s += 7) {
                        var l = o.substr(s, 7);
                        s != o.length - 7 && (l = "1" + l),
                        r += e(parseInt(l, 2))
                    }
                    return r
                };
                et.asn1.DERObjectIdentifier.superclass.constructor.call(this),
                this.hT = "06",
                this.setValueHex = function(t) {
                    this.hTLV = null,
                    this.isModified = !0,
                    this.s = null,
                    this.hV = t
                }
                ,
                this.setValueOidString = function(t) {
                    if (!t.match(/^[0-9.]+$/))
                        throw "malformed oid string: " + t;
                    var n = ""
                      , o = t.split(".")
                      , i = 40 * parseInt(o[0]) + parseInt(o[1]);
                    n += e(i),
                    o.splice(0, 2);
                    for (var a = 0; a < o.length; a++)
                        n += r(o[a]);
                    this.hTLV = null,
                    this.isModified = !0,
                    this.s = null,
                    this.hV = n
                }
                ,
                this.setValueName = function(t) {
                    var e = et.asn1.x509.OID.name2oid(t);
                    if ("" === e)
                        throw "DERObjectIdentifier oidName undefined: " + t;
                    this.setValueOidString(e)
                }
                ,
                this.getFreshValueHex = function() {
                    return this.hV
                }
                ,
                void 0 !== t && ("string" == typeof t ? t.match(/^[0-2].[0-9.]+$/) ? this.setValueOidString(t) : this.setValueName(t) : void 0 !== t.oid ? this.setValueOidString(t.oid) : void 0 !== t.hex ? this.setValueHex(t.hex) : void 0 !== t.name && this.setValueName(t.name))
            }
            ,
            tt.lang.extend(et.asn1.DERObjectIdentifier, et.asn1.ASN1Object),
            et.asn1.DEREnumerated = function(t) {
                et.asn1.DEREnumerated.superclass.constructor.call(this),
                this.hT = "0a",
                this.setByBigInteger = function(t) {
                    this.hTLV = null,
                    this.isModified = !0,
                    this.hV = et.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)
                }
                ,
                this.setByInteger = function(t) {
                    var e = new R(String(t),10);
                    this.setByBigInteger(e)
                }
                ,
                this.setValueHex = function(t) {
                    this.hV = t
                }
                ,
                this.getFreshValueHex = function() {
                    return this.hV
                }
                ,
                void 0 !== t && (void 0 !== t.int ? this.setByInteger(t.int) : "number" == typeof t ? this.setByInteger(t) : void 0 !== t.hex && this.setValueHex(t.hex))
            }
            ,
            tt.lang.extend(et.asn1.DEREnumerated, et.asn1.ASN1Object),
            et.asn1.DERUTF8String = function(t) {
                et.asn1.DERUTF8String.superclass.constructor.call(this, t),
                this.hT = "0c"
            }
            ,
            tt.lang.extend(et.asn1.DERUTF8String, et.asn1.DERAbstractString),
            et.asn1.DERNumericString = function(t) {
                et.asn1.DERNumericString.superclass.constructor.call(this, t),
                this.hT = "12"
            }
            ,
            tt.lang.extend(et.asn1.DERNumericString, et.asn1.DERAbstractString),
            et.asn1.DERPrintableString = function(t) {
                et.asn1.DERPrintableString.superclass.constructor.call(this, t),
                this.hT = "13"
            }
            ,
            tt.lang.extend(et.asn1.DERPrintableString, et.asn1.DERAbstractString),
            et.asn1.DERTeletexString = function(t) {
                et.asn1.DERTeletexString.superclass.constructor.call(this, t),
                this.hT = "14"
            }
            ,
            tt.lang.extend(et.asn1.DERTeletexString, et.asn1.DERAbstractString),
            et.asn1.DERIA5String = function(t) {
                et.asn1.DERIA5String.superclass.constructor.call(this, t),
                this.hT = "16"
            }
            ,
            tt.lang.extend(et.asn1.DERIA5String, et.asn1.DERAbstractString),
            et.asn1.DERUTCTime = function(t) {
                et.asn1.DERUTCTime.superclass.constructor.call(this, t),
                this.hT = "17",
                this.setByDate = function(t) {
                    this.hTLV = null,
                    this.isModified = !0,
                    this.date = t,
                    this.s = this.formatDate(this.date, "utc"),
                    this.hV = stohex(this.s)
                }
                ,
                this.getFreshValueHex = function() {
                    return void 0 === this.date && void 0 === this.s && (this.date = new Date,
                    this.s = this.formatDate(this.date, "utc"),
                    this.hV = stohex(this.s)),
                    this.hV
                }
                ,
                void 0 !== t && (void 0 !== t.str ? this.setString(t.str) : "string" == typeof t && t.match(/^[0-9]{12}Z$/) ? this.setString(t) : void 0 !== t.hex ? this.setStringHex(t.hex) : void 0 !== t.date && this.setByDate(t.date))
            }
            ,
            tt.lang.extend(et.asn1.DERUTCTime, et.asn1.DERAbstractTime),
            et.asn1.DERGeneralizedTime = function(t) {
                et.asn1.DERGeneralizedTime.superclass.constructor.call(this, t),
                this.hT = "18",
                this.withMillis = !1,
                this.setByDate = function(t) {
                    this.hTLV = null,
                    this.isModified = !0,
                    this.date = t,
                    this.s = this.formatDate(this.date, "gen", this.withMillis),
                    this.hV = stohex(this.s)
                }
                ,
                this.getFreshValueHex = function() {
                    return void 0 === this.date && void 0 === this.s && (this.date = new Date,
                    this.s = this.formatDate(this.date, "gen", this.withMillis),
                    this.hV = stohex(this.s)),
                    this.hV
                }
                ,
                void 0 !== t && (void 0 !== t.str ? this.setString(t.str) : "string" == typeof t && t.match(/^[0-9]{14}Z$/) ? this.setString(t) : void 0 !== t.hex ? this.setStringHex(t.hex) : void 0 !== t.date && this.setByDate(t.date),
                !0 === t.millis && (this.withMillis = !0))
            }
            ,
            tt.lang.extend(et.asn1.DERGeneralizedTime, et.asn1.DERAbstractTime),
            et.asn1.DERSequence = function(t) {
                et.asn1.DERSequence.superclass.constructor.call(this, t),
                this.hT = "30",
                this.getFreshValueHex = function() {
                    for (var t = "", e = 0; e < this.asn1Array.length; e++) {
                        var r = this.asn1Array[e];
                        t += r.getEncodedHex()
                    }
                    return this.hV = t,
                    this.hV
                }
            }
            ,
            tt.lang.extend(et.asn1.DERSequence, et.asn1.DERAbstractStructured),
            et.asn1.DERSet = function(t) {
                et.asn1.DERSet.superclass.constructor.call(this, t),
                this.hT = "31",
                this.sortFlag = !0,
                this.getFreshValueHex = function() {
                    for (var t = new Array, e = 0; e < this.asn1Array.length; e++) {
                        var r = this.asn1Array[e];
                        t.push(r.getEncodedHex())
                    }
                    return 1 == this.sortFlag && t.sort(),
                    this.hV = t.join(""),
                    this.hV
                }
                ,
                void 0 !== t && void 0 !== t.sortflag && 0 == t.sortflag && (this.sortFlag = !1)
            }
            ,
            tt.lang.extend(et.asn1.DERSet, et.asn1.DERAbstractStructured),
            et.asn1.DERTaggedObject = function(t) {
                et.asn1.DERTaggedObject.superclass.constructor.call(this),
                this.hT = "a0",
                this.hV = "",
                this.isExplicit = !0,
                this.asn1Object = null,
                this.setASN1Object = function(t, e, r) {
                    this.hT = e,
                    this.isExplicit = t,
                    this.asn1Object = r,
                    this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(),
                    this.hTLV = null,
                    this.isModified = !0) : (this.hV = null,
                    this.hTLV = r.getEncodedHex(),
                    this.hTLV = this.hTLV.replace(/^../, e),
                    this.isModified = !1)
                }
                ,
                this.getFreshValueHex = function() {
                    return this.hV
                }
                ,
                void 0 !== t && (void 0 !== t.tag && (this.hT = t.tag),
                void 0 !== t.explicit && (this.isExplicit = t.explicit),
                void 0 !== t.obj && (this.asn1Object = t.obj,
                this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)))
            }
            ,
            tt.lang.extend(et.asn1.DERTaggedObject, et.asn1.ASN1Object);
            var rt = function(t) {
                function e(r) {
                    var n = t.call(this) || this;
                    return r && ("string" == typeof r ? n.parseKey(r) : (e.hasPrivateKeyProperty(r) || e.hasPublicKeyProperty(r)) && n.parsePropertiesFrom(r)),
                    n
                }
                return function(t, e) {
                    function r() {
                        this.constructor = t
                    }
                    g(t, e),
                    t.prototype = null === e ? Object.create(e) : (r.prototype = e.prototype,
                    new r)
                }(e, t),
                e.prototype.parseKey = function(t) {
                    try {
                        var e = 0
                          , r = 0
                          , n = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(t) ? m.decode(t) : v.unarmor(t)
                          , o = O.decode(n);
                        if (3 === o.sub.length && (o = o.sub[2].sub[0]),
                        9 === o.sub.length) {
                            e = o.sub[1].getHexStringValue(),
                            this.n = N(e, 16),
                            r = o.sub[2].getHexStringValue(),
                            this.e = parseInt(r, 16);
                            var i = o.sub[3].getHexStringValue();
                            this.d = N(i, 16);
                            var a = o.sub[4].getHexStringValue();
                            this.p = N(a, 16);
                            var s = o.sub[5].getHexStringValue();
                            this.q = N(s, 16);
                            var l = o.sub[6].getHexStringValue();
                            this.dmp1 = N(l, 16);
                            var c = o.sub[7].getHexStringValue();
                            this.dmq1 = N(c, 16);
                            var u = o.sub[8].getHexStringValue();
                            this.coeff = N(u, 16)
                        } else {
                            if (2 !== o.sub.length)
                                return !1;
                            var p = o.sub[1]
                              , f = p.sub[0];
                            e = f.sub[0].getHexStringValue(),
                            this.n = N(e, 16),
                            r = f.sub[1].getHexStringValue(),
                            this.e = parseInt(r, 16)
                        }
                        return !0
                    } catch (t) {
                        return !1
                    }
                }
                ,
                e.prototype.getPrivateBaseKey = function() {
                    var t = {
                        array: [new et.asn1.DERInteger({
                            int: 0
                        }), new et.asn1.DERInteger({
                            bigint: this.n
                        }), new et.asn1.DERInteger({
                            int: this.e
                        }), new et.asn1.DERInteger({
                            bigint: this.d
                        }), new et.asn1.DERInteger({
                            bigint: this.p
                        }), new et.asn1.DERInteger({
                            bigint: this.q
                        }), new et.asn1.DERInteger({
                            bigint: this.dmp1
                        }), new et.asn1.DERInteger({
                            bigint: this.dmq1
                        }), new et.asn1.DERInteger({
                            bigint: this.coeff
                        })]
                    }
                      , e = new et.asn1.DERSequence(t);
                    return e.getEncodedHex()
                }
                ,
                e.prototype.getPrivateBaseKeyB64 = function() {
                    return p(this.getPrivateBaseKey())
                }
                ,
                e.prototype.getPublicBaseKey = function() {
                    var t = new et.asn1.DERSequence({
                        array: [new et.asn1.DERObjectIdentifier({
                            oid: "1.2.840.113549.1.1.1"
                        }), new et.asn1.DERNull]
                    })
                      , e = new et.asn1.DERSequence({
                        array: [new et.asn1.DERInteger({
                            bigint: this.n
                        }), new et.asn1.DERInteger({
                            int: this.e
                        })]
                    })
                      , r = new et.asn1.DERBitString({
                        hex: "00" + e.getEncodedHex()
                    })
                      , n = new et.asn1.DERSequence({
                        array: [t, r]
                    });
                    return n.getEncodedHex()
                }
                ,
                e.prototype.getPublicBaseKeyB64 = function() {
                    return p(this.getPublicBaseKey())
                }
                ,
                e.wordwrap = function(t, e) {
                    if (e = e || 64,
                    !t)
                        return t;
                    var r = "(.{1," + e + "})( +|$\n?)|(.{1," + e + "})";
                    return t.match(RegExp(r, "g")).join("\n")
                }
                ,
                e.prototype.getPrivateKey = function() {
                    var t = "-----BEGIN RSA PRIVATE KEY-----\n";
                    return t += e.wordwrap(this.getPrivateBaseKeyB64()) + "\n",
                    t += "-----END RSA PRIVATE KEY-----"
                }
                ,
                e.prototype.getPublicKey = function() {
                    var t = "-----BEGIN PUBLIC KEY-----\n";
                    return t += e.wordwrap(this.getPublicBaseKeyB64()) + "\n",
                    t += "-----END PUBLIC KEY-----"
                }
                ,
                e.hasPublicKeyProperty = function(t) {
                    return (t = t || {}).hasOwnProperty("n") && t.hasOwnProperty("e")
                }
                ,
                e.hasPrivateKeyProperty = function(t) {
                    return (t = t || {}).hasOwnProperty("n") && t.hasOwnProperty("e") && t.hasOwnProperty("d") && t.hasOwnProperty("p") && t.hasOwnProperty("q") && t.hasOwnProperty("dmp1") && t.hasOwnProperty("dmq1") && t.hasOwnProperty("coeff")
                }
                ,
                e.prototype.parsePropertiesFrom = function(t) {
                    this.n = t.n,
                    this.e = t.e,
                    t.hasOwnProperty("d") && (this.d = t.d,
                    this.p = t.p,
                    this.q = t.q,
                    this.dmp1 = t.dmp1,
                    this.dmq1 = t.dmq1,
                    this.coeff = t.coeff)
                }
                ,
                e
            }(X)
              , nt = function() {
                function t(t) {
                    t = t || {},
                    this.default_key_size = parseInt(t.default_key_size, 10) || 1024,
                    this.default_public_exponent = t.default_public_exponent || "010001",
                    this.log = t.log || !1,
                    this.key = null
                }
                return t.prototype.setKey = function(t) {
                    this.log && this.key && console.warn("A key was already set, overriding existing."),
                    this.key = new rt(t)
                }
                ,
                t.prototype.setPrivateKey = function(t) {
                    this.setKey(t)
                }
                ,
                t.prototype.setPublicKey = function(t) {
                    this.setKey(t)
                }
                ,
                t.prototype.decrypt = function(t) {
                    try {
                        return this.getKey().decrypt(f(t))
                    } catch (t) {
                        return !1
                    }
                }
                ,
                t.prototype.encrypt = function(t) {
                    try {
                        return p(this.getKey().encrypt(t))
                    } catch (t) {
                        return !1
                    }
                }
                ,
                t.prototype.sign = function(t, e, r) {
                    try {
                        return p(this.getKey().sign(t, e, r))
                    } catch (t) {
                        return !1
                    }
                }
                ,
                t.prototype.verify = function(t, e, r) {
                    try {
                        return this.getKey().verify(t, f(e), r)
                    } catch (t) {
                        return !1
                    }
                }
                ,
                t.prototype.getKey = function(t) {
                    if (!this.key) {
                        if (this.key = new rt,
                        t && "[object Function]" === {}.toString.call(t))
                            return void this.key.generateAsync(this.default_key_size, this.default_public_exponent, t);
                        this.key.generate(this.default_key_size, this.default_public_exponent)
                    }
                    return this.key
                }
                ,
                t.prototype.getPrivateKey = function() {
                    return this.getKey().getPrivateKey()
                }
                ,
                t.prototype.getPrivateKeyB64 = function() {
                    return this.getKey().getPrivateBaseKeyB64()
                }
                ,
                t.prototype.getPublicKey = function() {
                    return this.getKey().getPublicKey()
                }
                ,
                t.prototype.getPublicKeyB64 = function() {
                    return this.getKey().getPublicBaseKeyB64()
                }
                ,
                t.version = "3.0.0-rc.1",
                t
            }();
            return nt
        }()

function encryptPassword(e, t) {
    if (t.passwordEncrypt)
        try {
            var n = new encryptClass();
            return n.setPublicKey(t.publicKey),
            n.encrypt(e)
        } catch (e) {
            console.log(e)
        }
    return e
}

var _e = function(r) {
            var t, n, o = {
                encoding: "x"
            }, e = {
                _cO: [[-1658786019, 1493325398, 302215178, 135624897, -783129214, -2103672236, -1658334583, -1121316849], [1755450666, 714729647, 1577142459, 1932142337, 404359373, -1842008283, 694480344, -1009175083]],
                "_bf": 16,
                _dD: function(r, t) {
                    return t >>> r | t << 32 - r
                },
                _cc: function(r) {
                    return e._dD(2, r) ^ e._dD(13, r) ^ e._dD(22, r)
                },
                "_cA": function(r) {
                    return e._dD(6, r) ^ e._dD(11, r) ^ e._dD(25, r)
                },
                _dY: function(r) {
                    return e._dD(7, r) ^ e._dD(18, r) ^ r >>> 3
                },
                _ct: function(r) {
                    return e._dD(17, r) ^ e._dD(19, r) ^ r >>> 10
                },
                "_ci": function(r, t, n) {
                    return r & t ^ ~r & n
                },
                "_y": function(r, t, n) {
                    return r & t ^ r & n ^ t & n
                },
                "_ce": [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298],
                _da: function(r) {
                    try {
                        var t, n, o, e, c = "", _ = [];
                        for (t = 0,
                        o = r.length; t < o; t++)
                            (n = r.charCodeAt(t)) < 128 ? _.push(n) : n < 2048 ? _.push(192 | n >> 6, 128 | 63 & n) : n < 55296 || n >= 57344 ? _.push(224 | n >> 12, 128 | n >> 6 & 63, 128 | 63 & n) : (t++,
                            n = 65536 + ((1023 & n) << 10 | 1023 & r.charCodeAt(t)),
                            _.push(240 | n >> 18, 128 | n >> 12 & 63, 128 | n >> 6 & 63, 128 | 63 & n));
                        for (t = 0,
                        e = _.length; t < e; t++)
                            c += String.fromCharCode(_[t]);
                        return c
                    } catch (r) {
                        throw new Error("bad")
                    }
                },
                "_bE": function(r) {
                    var t, n = [];
                    for (t = 3; t >= 0; t--)
                        n[3 - t] = r >>> 8 * t & 255;
                    return n
                },
                "_co": function(r) {
                    var t, n, o, c, _, a = "";
                    for (t = 0,
                    o = r.length; t < o; t++)
                        for (n = 0,
                        _ = (c = e._bE(r[t])).length; n < _; n++)
                            a += String.fromCharCode(c[n]);
                    return a
                },
                _dR: function(r) {
                    var t, n, o, c, _, a = "";
                    for (t = 0,
                    c = r.length; t < c; t++)
                        for (o = 0,
                        _ = (n = e._bE(r[t])).length; o < _; o++)
                            a += (n[o] < 16 ? "0" : "") + n[o].toString(16);
                    return a
                },
                "_ba": function(r) {
                    if (0 === r.length)
                        return "";
                    if (r.length % 2 == 1)
                        throw Error("Odd-length string");
                    var t, n = "", o = r.match(/[0-9a-f]{2}/gi), e = o.length;
                    for (t = 0; t < e; t++)
                        n += String.fromCharCode(parseInt(o[t], 16));
                    return n
                }
            }, c = {}, _ = !(D = []) + c, a = _[2];
            t = "g" + (A = _[4]),
            n = (_ = !!~c + c)[0] + A.toUpperCase() + a + A;
            var f = document;
            switch (f = f[t + n + "m" + A + "ntB" + ["d", "I", "y"].reverse().join("")],
            "object" != typeof o && (o = {}),
            o.encoding) {
            case "hex":
                r = e._ba(r);
                break;
            default:
                r = e._da(r)
            }
            var h = (r += String.fromCharCode(128)).length / 4 + 2
              , d = Math.ceil(h / e._bf)
              , i = [];
            for (O = 0; O < d; O++)
                for (i[O] = [],
                y = 0; y < e._bf; y++)
                    i[O][y] = r.charCodeAt(64 * O + 4 * y) << 24 | r.charCodeAt(64 * O + 4 * y + 1) << 16 | r.charCodeAt(64 * O + 4 * y + 2) << 8 | r.charCodeAt(64 * O + 4 * y + 3);
            var u = r.length + 4 * e._bf - 1;
            i[d - 1][e._bf - 2] = 8 * u / Math.pow(2, 32),
            i[d - 1][e._bf - 2] = Math.floor(i[d - 1][e._bf - 2]),
            i[d - 1][e._bf - 1] = 8 * u & 4294967295;
            var b = i
              , g = e._cO[0].slice()
              , s = [];
            d = b.length;
            for (O = 0; O < d; O++) {
                for (y = 0; y < e._bf; y++)
                    s[y] = b[O][y];
                for (y = e._bf; y < 64; y++)
                    s[y] = e._ct(s[y - 2]) + s[y - 7] + e._dY(s[y - 15]) + s[y - 16],
                    s[y] &= 4294967295;
                for (v = g[0],
                w = g[1],
                m = g[2],
                D = g[3],
                A = g[4],
                S = g[5],
                k = g[6],
                M = g[7],
                y = 0; y < 64; y++) {
                    var l = M + e._cA(A) + e._ci(A, S, k) + e._ce[y] + s[y]
                      , C = e._cc(v) + e._y(v, w, m);
                    M = k,
                    k = S,
                    S = A,
                    A = D + l & 4294967295,
                    D = m,
                    m = w,
                    w = v,
                    v = l + C & 4294967295
                }
                g[0] = g[0] + v & 4294967295,
                g[1] = g[1] + w & 4294967295,
                g[2] = g[2] + m & 4294967295,
                g[3] = g[3] + D & 4294967295,
                g[4] = g[4] + A & 4294967295,
                g[5] = g[5] + S & 4294967295,
                g[6] = g[6] + k & 4294967295,
                g[7] = g[7] + M & 4294967295
            }
            var p = g;
            r = e._co(p);
            h = (r += String.fromCharCode(128)).length / 4 + 2,
            d = Math.ceil(h / e._bf),
            i = [];
            for (O = 0; O < d; O++)
                for (i[O] = [],
                y = 0; y < e._bf; y++)
                    i[O][y] = r.charCodeAt(64 * O + 4 * y) << 24 | r.charCodeAt(64 * O + 4 * y + 1) << 16 | r.charCodeAt(64 * O + 4 * y + 2) << 8 | r.charCodeAt(64 * O + 4 * y + 3);
            u = r.length + 4 * e._bf - 1;
            i[d - 1][e._bf - 2] = 8 * u / Math.pow(2, 32),
            i[d - 1][e._bf - 2] = Math.floor(i[d - 1][e._bf - 2]),
            i[d - 1][e._bf - 1] = 8 * u & 4294967295,
            b = i,
            g = e._cO[1].slice();
            var v, w, m, D, A, S, k, M, O, y;
            s = [],
            d = b.length;
            for (O = 0; O < d; O++) {
                for (y = 0; y < e._bf; y++)
                    s[y] = b[O][y];
                for (y = e._bf; y < 64; y++)
                    s[y] = e._ct(s[y - 2]) + s[y - 7] + e._dY(s[y - 15]) + s[y - 16],
                    s[y] &= 4294967295;
                for (v = g[0],
                w = g[1],
                m = g[2],
                D = g[3],
                A = g[4],
                S = g[5],
                k = g[6],
                M = g[7],
                y = 0; y < 64; y++) {
                    l = M + e._cA(A) + e._ci(A, S, k) + e._ce[y] + s[y],
                    C = e._cc(v) + e._y(v, w, m);
                    M = k,
                    k = S,
                    S = A,
                    A = D + l & 4294967295,
                    D = m,
                    m = w,
                    w = v,
                    v = l + C & 4294967295
                }
                g[0] = g[0] + v & 4294967295,
                g[1] = g[1] + w & 4294967295,
                g[2] = g[2] + m & 4294967295,
                g[3] = g[3] + D & 4294967295,
                g[4] = g[4] + A & 4294967295,
                g[5] = g[5] + S & 4294967295,
                g[6] = g[6] + k & 4294967295,
                g[7] = g[7] + M & 4294967295
            }
            p = g;
            var j = "";
            switch (o.encoding) {
            case "hex":
                j = e._dR(p);
                break;
            case "binary":
                j = e._co(p);
                break;
            default:
                j = e._dR(p)
            }
            return j
        }

function getRiskSign(r, t){
    var n = new Date().getTime();
    return {
        riskSign: _e("username=".concat(r || "", "&password=").concat(t || "", "&ts=").concat(n)),
        timestamp: n
    }
}


function getLoginParams(username, password, encrypt_api_data) {
    var o = username
      , i = password
      , c = ""
      , s = ""
      , f = {
        username: o,
        password: encryptPassword(i, encrypt_api_data),
        passwordEncrypt: encrypt_api_data.passwordEncrypt,
        verificationCode: c,
        mobileVerifyCode: c,
        sign: s,
    };
    var riskSignData = getRiskSign(f.username, f.password)
    return Object.assign(riskSignData, f)
}

module.exports = function(path, controller) {
	// key 可以是任何值只要不重复就可以
	controller[path] = {getLoginParams}
}